Input/Output: Graphics: Histogram – StdDraw

Screen Shot 2015-02-23 at 12.19.21 AM

Classwork:
Standard Drawing
histogram
Suppose that the standard input stream is a sequence of double values. Write a program that takes an integer N and two double values left and right from the command line, StdIn, or Scanner and uses StdDraw to plot a histogram of the frequency 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.
The intervals’ marks and labels are optional.
Assumption: data values range from 0 to 100
Extra challenge: no range of values is known.

For development purpose ONLY, you can hard code the data or have a text file with the data. Make sure you have at least 30 data values with a good amount of variation in the values. Take a screenshot and turn in both the image and the data values.

Suggestion:
– Start by drawing a rectangle given the width and height as input.
– Next, draw n number of rectangles given the width, both n and width as input. For learning purposes, use a sample array of integers representing the frequency (the height of each rectangle) at each position.
– Last, replace the array of integers with the frequency of integers from the input stream based on the above specification. At this point you can add to your implementation the other constraints, left, right and N.

Homework:
Complete missing assignments.