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:
Joined
Mar 28, 2022
Messages
82
Reaction score
11
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:

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top