Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ For this assignment youre going to write the program Rock Paper Scissors game. The user will play against the computer. A scissor can cut

C++

For this assignment youre going to write the program Rock Paper Scissors game. The user will play against the computer. A scissor can cut paper, a rock can knock a scissor, and paper can wrap a rock. One game of the Rock Paper Scissors will be such that your user will play continuously until the user or computer wins more than two times. That is, the game will stop when one of the players wins two games.

The user may play as many games as he/she likes.

  1. When your program begins, you should show your course header using a cout.
  2. Then explain how the game is played in another cout.
  3. Declare some variables to use in the program and also seed rand.
  4. Open a do-while loop as a game play loop. This is the loop that continues if the user says yes to the question, Do you want to play again?.
  5. Open another do-while loop. This is the round loop that runs the rock-paper-scissors game. It is needed so the player can play until the user or the computer has won twice. They have then won the round.
  6. Ask the user to select his/her choice (rock, paper, scissors) by displaying a menu where and asking the user to enter a number.
  7. After the user has entered his/her choice, the program uses a random number generator for the computers selection. There cannot be a tie, so make sure the computer number is not the same as the user number. This means using another loop, a while loop.
  8. Your program will evaluate who won that round.
  9. The program reports what the computer chose, the users choice and who won that round.
  10. The program s round loop will continue presenting a round until either the user or the computer has won the game.
  11. When the game is won, the computer announces who won the game and asks the user if they want to play another game. If the answer is yes, the program loops up to the top of the game play loop and begins again.
  12. If the user answers no, the program drops out of the game play loop and displays the game tally. The game tally shows number of games played and the number of wins for the player.
  13. After all play is completed, give a good bye message.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Larry Ellison Database Genius Of Oracle

Authors: Craig Peters

1st Edition

0766019748, 978-0766019744

More Books

Students also viewed these Databases questions