| Problem: |
To create a program that will allow the user to play the game "Rock-Paper-Scissors"
with the computer.
Rock-Paper-Scissors is a simple child's game where each player randomly
chooses to be either a rock, a sheet of paper or a pair of scissors, choosing
simultaneously at the count of three.
A winner is determined as follows:
Rock breaks scissors
Scissors cut paper
Paper covers rock.
At the end of each round, the program should display each player's
choice, who won, and the current score. Next, the game should ask the user
whether to play another round, and so forth. |
| Task: |
-
Review the use of the if and while structures, as well as
the use of the function rand()
-
Create a class, cGame, to represent the game
-
Include member variables for ...
-
first name
-
current score
-
number of rounds played
-
Include member functions to ...
-
initialize an game object with zeros for both the total score and number
of rounds played (constructor)
-
Run (or manage) the game, accounting for an unknown number of rounds to
be played
-
Determine which player (user or computer) has won a given round
-
Display the current score
-
Submit your assignment according to Project
Submission Guidelines.
|
| Notes: |
-
Remember! Be sure you've completed this project as described above.
If you wish to do more, you will neither receive extra points if you succeed,
nor lose points if you you are unsuccessful, but you will receive feedback
when the project is graded.
|