Anyone can help me w these?


Joined
Aug 12, 2022
Messages
6
Reaction score
0
Write a program that declares at least two variables: x of type double and j of type int. Ask the user to
input a value for x (between 1.0 – 2.0) and then calculate and print out j so that it satisfies the following
table:

1660305890145.png


This sort of calculation is exactly what one must do when sorting data ready for plotting as a histogram.
 
Last edited:
Ad

Advertisements

Joined
Mar 28, 2022
Messages
82
Reaction score
10
The task is to partition the range [min .. max] into numSections of equal sectionWidth

sectionWidth = (max - min) / numSectionswidth of a section
sectionWidth × numSections = max - min multiply both sides by numSections
numSections = (max - min) / sectionWidthdivide both sides by sectionWidth

Either numSections or sectionWidth must be provided to calculate the other.
In the table given, sectionWidth was implied to be 1/10, thus numSections was 10
 
Last edited:
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top