Your programs must have inline, online, and external documentation. They must be user friendly, and check for errors in user input. They should also have appropriate messages. At this point in the course, use all the features of the language that you have learned, and read the API to apply new ideas to your source.
1. Magic number. Write a program that generated a number between 1 and 10. Have the user guess at the number. Display appropriate messages as the user guesses. Keep track of and display the following information when the user either quits or guesses correctly:
The magic number
Did the user win or quit?
Total guesses
2. The Tortoise and The Hare. Have the tortoise and hare complete a race of x units long. The user will decide on the length of the race. You should decide what a minimum race length should be. Use a random number to determine the distance each travels per unit time. On each turn, display the current position of both the tortoise and the hare.
Tortoise:
50% 3 squares ahead
20% 6 squares back
30% 1 square ahead
Hare:
20% no move
20% 9 squares ahead
10% 12 squares back
30% 1 square ahead
20% 2 squares back
3. Coin toss game. Toss a coin many (how many is many?) times and for each head add one to a counter and for each tail subtract one from the counter. Display the counter versus the number of tosses.
Summative Evaluation
If you can't see the document, please read: You Do Not Need Permission To View Any Documents.