Question: I need help with the following program: Write a program to score the paper-rock-scissor game. Each of two users types in either P, R, or

I need help with the following program:

Write a program to score the paper-rock-scissor game. Each of two users types in either P, R, or S. The program then announces the winner as well as the basis for determining the winner: Paper covers rock, Rock breaks scissors, Scissors cut paper, or Nobody wins. Be sure to allow the users to use lowercase as well as uppercase letters. Your program should include a loop that lets the user play again until the user says she or he is done.

*Please keep in mind I need to use SWITCH STATEMENTS Only!

Output Should Be:

Player 1: R Player 2: S

Player 1 wins

again? Y

Player 1: R Player 2: R

Its a tie

again? Y

Player 1: P Player 2: S

Player 2 wins.

again? N

DO NOT use if / else for this assignment.

Yes, this requires a nested switch statement:

Read player one and player two options: (R, P, or S - both upper and lower case for this and virtually any project you do in my classes.)

Four cases for player 1: R, P, S and never forget the default case. Within each of the first three cases, there are four cases for player two.

"default" should be used as well in the switch statements just in case if the user enters an invalid value.

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 Databases Questions!