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 Rock-Paper-Scissors 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:
1. weapon_menu()- Asks the user to input their choice: (R)ock,(P)aper,(S)cissors,
or (B)ack. Checks user input for validity and then returns the inputted value.
2. comp_weapon()- Randomly chooses the computers throw and returns an R,
P, or S.
3. find_winner(player, 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 (0=Tie, 1=Player, 2=Computer).
a. Rock crushes Scissors
b. Scissors cuts Paper
c. Paper covers Rock
4. display_scores(player, comp)- Displays the scores

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!