Question: Write a program that allows a user to play Rock - Paper - Scissors against the computer. Have the program keep score of how many
Write a program that allows a user to play RockPaperScissors against the computer. Have the
program keep score of how many times each has won a round. Your program should have a
main method that has a loop that repeats the game until the user chooses to quit. Display the
final score before exiting.
Write the following functions:
weaponmenu Asks the user to input their choice: RockPaperScissors
or Back Checks user input for validity and then returns the inputted value.
compweapon Randomly chooses the computers throw and returns an R
P or S
findwinnerplayer comp Passes in the two weapons R P or S
displays the throws, compares the two weapons and displays the result and returns
who is the winner of that round Tie, Player, Computer
a Rock crushes Scissors
b Scissors cuts Paper
c Paper covers Rock
displayscoresplayer comp Displays the scores
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
