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, 22.06.2019 01:50
Click on this link toopens a new window. bring up a flowchart in a new browser window. based on this flowchart, would a d-link 3347 gateway with an xbox 360 multiplayer problem be in scope or out of scope
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
What are the most commonly found items in the trash according to the municipal solid waste report?
Answers: 1
question
Computers and Technology, 25.06.2019 01:30
What was the advantage of using transistors instead of vacuum tubes in the second-generation computers? a. computers were drastically reduced in size. b. computers no longer produced errors. c. computers became affordable. d. computers could run on electricity.
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
Arts, 10.12.2020 07:10
question
Mathematics, 10.12.2020 07:10
question
Mathematics, 10.12.2020 07:10
Questions on the website: 13722363