Question: Write a program using C++ that lest the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.
Write a program using C++ that lest the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows.
When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, than 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. (dont display the computers choice yet.)
The user enters his or her choice of rock, paper, or scissors at the key-board.
The computers choice is displayed. A winner is selected according the to following rules:
If one player chooses rock and the computer chooses scissors, than rock wins (the rock smashes the scissors.)
If one player chooses scissors and the computerr chooses paper, then scissors win. (scissors cut paper)
If one player chooses paper and the computer chooses rock, then paper wins (paper wraps rock)
If both players make the same choice, the game must be played again to determine the winner.
Be sure to keep track of the number of wins for the player and computer. Program should run until the player is finished with the game.
When players is finished running the program, it should display the total wins and determine the winner.
Please use good comments. (Finished in 2-3 hours if please possible)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
