Cover page images (keyboard)

HW 7 - Graphics


Extension given.

Now due 11/08/10 before 11:59 PM

Sue Evans

Hit the space bar for next slide

The Hailstone Sequence II

For this homework, we'll be modifying homework 6 by adding another option for the user to choose:

H - view a Histogram of chain lengths for a range

Do NOT modify your original hw6.py file. Instead make a copy of your hw6.py file in your hw7 directory named hw7.py














The Task

We'll be using some of the methods from the graphics library to draw a histogram of chain lengths for a range of values. This histogram will be drawn in a window. How big should the window be ? It depends on the user's input.

The Modifications

First, the obvious modifications are :

Now that you have everything set up, write the function drawHistogram()

Specifications for drawHistogram()

Sample Histograms

Here's the histogram for the range 2 to 11 :



Here's the histogram for the range 16 to 25 :



Submitting Your Work

After you've finished your assignment, use the submit command to turn it in.

Don't forget to watch for the confirmation that submit worked correctly. Specifically, the confirmation will say:

Submitting hw7.py...OK

If not, try again.

You can check your submission by entering
submitls cs201 HW7
You should see the name of the file that you just submitted, in this case, hw7.py.