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
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