CS21 Spring 2005
Homework 4
Due Sunday, Feb. 6, before 11:30pm


Answer the following Review Questions from the C book on your own, but do not turn them in. We will post answers on the CS21 web page next week.

Please complete the following 3 programs and turn them in. The main task of this week's homework is to create a program that plays the game of Rock-Paper-Scissors. This is a fairly simple game that can be implemented with less than 10 functions. However, to help you get in the habit of testing your functions as you code them in, we want you to write this program in pieces. Program 1 asks you to write a menu function and a GetUserChoice function (and a main function that tests them both). Program 2 asks you to add a DetermineWinner function. Finally, Program 3 asks you to put the whole game together.

We will only grade Program 3. However, you should first implement Program 1, then Program 2, and finally Program 3. By following this approach for future, more complex programs, you will save yourself many hours of debugging time.


Please use the cs21handin command to turn in your homework.