Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Program 1 , Histogram , takes an integer n , and two integers left and right, and uses StdDraw to plot a histogram of the

Program 1,Histogram, takes an integer n, and two integers left and right, and uses StdDraw to plot a histogram of the count of the numbers in the standard input stream that fall in each of the n intervals defined by dividing (left, right) into n equal-sized intervals.
Note: The program is to read the values from an input file whose first line would contain n,left, and right values. The remaining lines would contain the sequence of integer values.
A sample run would be as follows. Please note that the program would read the input data from a file whose name is specified via the redirection operator "<.
>more data.txt
44080
52417261
7160505261
774161707941
6760506176
>java Histogram < data.txt
It should plot a histogram where the x-axis points are 40,50,60,70,80 and the intervals are 40-50,50-60,60-70,70-80. The height of the rectangles for the intervals should be 3,4,7,6 respectively.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions