Thursday, December 09, 2004

Assignments

I've given instructions for the last assignment, and for the next assignment. I have graded your Sum Numbers programs, please open that file and check the message I left for you at the bottom of your program. Once you have checked your grade, please move the file to your own documents folder and delete it from the V drive. A couple of you need to redo the assignment, you can look off this page to see what the program is supposed to do.

Make sure that all of your files are saved in your documents folder, and only programs you are turning in are put in the Public folder.

Right now, please go to the folder with the programs in it so you are looking at it. I'm going to show you what to do so that you can easily open these files.

Guessing Game Program

Here is the output that should be given by the Guessing Game program:
~~~~~~~~~~~~~~

This is a game where you try to guess my number in as few tries as possible.

You need to tell me the range of numbers to pick a number in, then you will guess it.

What number should be the lowest possible?
?
What number should be the highest possible?
?

What is your guess?
?
That's too high.

What is your guess?
?
That's too low.

What is your guess?
?
You got it in only _ tries.

~~~~~~~~~~~~~
A random number between the two numbers picked should be chosen, then the program should continue taking guesses until the correct answer is guessed. After each guess tell whether the number is too high or too low. As a bonus, display a different message if they guess a number that is not in the original range. When the number is finally guessed, be sure to tell how many guesses it took.

Another bonus would be to ask if the user wants to play another game.

The text does not need to be exact, but the basic message should be same.

Sum Numbers Program

Here is the output that should be given by the Sum Numbers program:
~~~~~~~~~~~~~~

This program will add all the numbers in a given range.
What number should I start at?
?
What number should I end on?
?

The total of all the numbers from _ to _ is _____.


~~~~~~~~~~~~~
The text does not need to be exact, but the basic message should be same.