Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make a histogram

Status
Not open for further replies.

chineerat

Technical User
Oct 12, 2003
42
TT
ok there a file that contains data from an experiment. a histogram is to be created in order to see the distribution of the data. text-based screen will have to be used. The following is a sample of the required output.


Cosmos Experiment #1

x000
x000000
x0000
x000000000000000000
x0000000000000000000000000
x000
x000
x
x000000000000000000000000000000000000000000000000000000000000
x0

Bin size = 11.55

design and create a program that reads the data and divides it into 10 bins of a size to be determined from the data. The program also scales the frequency of each bin so that the highest value will be equal to 60 i.e. there will be 60 '0's at the highest bar. Each bin location is denoted by an 'x' and the amount of '0's indicate the frequency. The title of the experiment is given as the first line of the data file and must be printed centered at the top of the graph. Assume that the width of the graph is 70 chars. The calculated bin size is printed at the end of the graph.

The data file may have erroneous values, the program should detect these and exit, printing out the line number from the file, at which the erroneous data was detected.


Gaz it uP
 
>design and create a program that ...

I have a better idea. You design and create the program.

Should you run into trouble, post information about the secific error, and then we'll help you.

What you've posted isn't really a question, more of a work description.



/Per

if (typos) cout << &quot;My fingers are faster than my brain. Sorry for the typos.&quot;;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top