subject

Construct a C++ program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows:
When the program begins, the user enters his or her choice of "rock", "paper", or "scissors" at the keyboard using a menu in a function named Selection, that returns a character.
Next, there should be a function, C, that generates the computer’s play. A random number in the range of 1 through 3 is generated. (NOTE: You’ll have to do some research on how to create random numbers correctly.) 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, then the computer has chosen scissors. The computer’s choice is returned as a character.
After, a function, W, will determine the winner between the user’s choice vs. the computer’s choice. (NOTE: It will return nothing, but it will take in the user’s choice and the computer’s choice as the two arguments.) The result is selected according to the following rules:
If one player chooses rock and the other player chooses scissors, then rock wins. (The rock smashes the scissors.)
If one player chooses scissors and the other player chooses paper, then scissors win. (Scissors cuts paper.)
If one player chooses paper and the other player chooses rock, then paper wins. (Paper wraps rock.)
If both players make the same choice, the game ends in a draw and there is no winner.
Finally, after a result is selected, there should be a function, Option, in which the player should have the option of playing again. This should return a boolean. Be sure that the program contains at least the four functions mentioned.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 20:00
2.)how does a graphical user interface (gui) on a touchscreen interface differ from a gui on a desktop or laptop? a.)a finger or stylus is used instead of a pointer. b.) a magic wand is used instead of a pointer. c.)users speak commands instead of using a pointer. d.)users visualize commands instead of using a pointer.
Answers: 1
question
Computers and Technology, 22.06.2019 20:00
What is the term for water wave that is created by an underwater earthquake
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
Write a program that inserts the digits of an integer into an array in originalorderfollowed by reverse order. first, promptthe user to enter a positive integer(> 0). determine the number of digits of the integer. create a dynamically allocated integer arrayof a size twice the number of digits.now insert the digits in original order which will occupy half of the array. then, insert the digits in reverse order.finally, output thedigits in thearray.use at least two functions to organize your program.
Answers: 3
question
Computers and Technology, 23.06.2019 16:30
If i wanted to include a built-in calendar in a document, what option could i select? draw table insert table insert chart quick tables
Answers: 1
You know the right answer?
Construct a C++ program that lets the user play the game of Rock, Paper, Scissors against the comput...
Questions
question
Mathematics, 04.03.2020 05:20
question
Spanish, 04.03.2020 05:21
Questions on the website: 13722359