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, 21.06.2019 18:30
Which statement best explains how plant cells use photosynthesis to maintain homeostasis? they use glucose and water to make energy. they break down glucose into fat. they combine oxygen and water to make glucose. they make glucose from carbon dioxide and water.
Answers: 1
question
Computers and Technology, 22.06.2019 03:30
Which group on the home tab allows you to add shapes to a powerpoint slide?
Answers: 1
question
Computers and Technology, 22.06.2019 10:30
You are almost finished updating a web site. as part of the update, you have converted all pages from html 4.0 to html5. the project is currently on schedule. however, your project manager has been asked by the marketing team manager to justify a day of time spent validating the site's html5 pages. the marketing team manager does not have technical knowledge of the internet or the web. which is the most appropriate explanation to provide to the marketing team manager?
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Facial expressions and gestures are examples of messages.
Answers: 3
You know the right answer?
In C++ programming please.
Rock, Paper, Scissors Game.
a) Write a program that lets the...
Questions
question
Mathematics, 26.03.2021 23:10
question
History, 26.03.2021 23:10
Questions on the website: 13722367