Write a C++ program that lets the user play the game of “Rock, Paper, Scissors”
against the computer. Divide the program into functions that perform each major task. The
program MUST include the following:
1. Do…While Loop
2. Menu function
3. Minimum of three task functions (Example: “rock”, “paper”, “scissors”)
The program will perform as follows (check out the logic flowchart on the page three):
1. When the program begins, a random number in the range of 1 through 3 is generated. If
the number is a 1, then the computer has chosen “rock”. If the number is 2, the
computer has chosen “paper”. If the number is 3, the computer has chosen “scissors”.
(But don’t display the computer’s choice yet).
2. The user then enters his/her choice of “rock”, “paper”, or “scissors” at the keyboard
(this is the logical place to use a menu ).
3. The computer’s choice is then displayed on the console.
4. A winner is selected according to the following rules:
a. If one player chooses rock and the other player chooses scissors, then rock wins.
(Rock smashes scissors).
b. If one player chooses scissors and the other player chooses paper, then scissors
wins. (Scissors cut paper).
c. If one player chooses paper and the other player chooses rock, then paper wins.
(Paper wraps rock).
d. If both players make the same choice, it is a tie, and the game must be played
again to determine a winner.