subject

In C++ programming please.
Rock, Paper, Scissors Game.
a) Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:
1. When the program begins, a random number in the range of 1 through 3 is generated (1+rand()%3). If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, them the computer has chosen scissors. (Don't display computer's choice yet).
2. The user enters his or her choice of "rock", "paper", or "scissors" at the keyboard. (You can use a menu if you prefer).
3. The computer's choice is displayed.
4. A winner is selected according to the rock paper scossors game riles.
Be sure to divide the program into the following functions:
int getUserChoice ();
The getUserChoice function displays a menu allowing the user to select rock, paper, or scissors.
4 to Quit the game
The function then returns 1 for rock, or 2 for paper, or 3 for scissors.
User input validation of the choices
int getComputerSchoice ();
The getComputerChoice function returns the computer's game choice.
It returns 1 for rock (via the ROCK constant), or 2 for paper (via the PAPER constant), or 3 for scissors
determineWinner (int, int);
The determineWinner function accepts the user's game choice and the computer's game choice as arguments and displays the choices, and a message indicating the winner.
void displayChoice (int);
The displayChoice function accepts an integer argument and displays rock, paper, or Scissors.
int main ()
Loop while user choice is not 4 (Quit the game)

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 05:00
Lisa has a section of her document that she would like to include in the index. which option should lisa choose? mark index mark entry insert endnote add text
Answers: 3
question
Computers and Technology, 22.06.2019 09:00
Howard is designing a chair swing ride. the swing ropes are 5 meters long, and in full swing they tilt in an angle of 29° outside chairs to be 2.75 m above the ground in full swing.
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
question
Computers and Technology, 23.06.2019 09:00
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
You know the right answer?
In C++ programming please.
Rock, Paper, Scissors Game.
a) Write a program that lets the...
Questions
question
Mathematics, 27.06.2020 02:01
question
Mathematics, 27.06.2020 02:01
question
Biology, 27.06.2020 02:01
question
Mathematics, 27.06.2020 02:01
question
Mathematics, 27.06.2020 02:01
question
Mathematics, 27.06.2020 02:01
Questions on the website: 13722360