Question: Write a program that implements a Rock/Paper/Scissors game that allows the user to play the computer. The program should prompt the user to enter R,

Write a program that implements a Rock/Paper/Scissors game that allows the user to play the computer. The program should prompt the user to enter R, P, or S for Rock, Paper, or Scissors, then it should randomly generate the computers choice and determine who won and display the result. The program should allow the user to continue playing until the user decides to stop, displaying the score (number of times that the computer won, the number of times that the player won and the number of ties). In this game, Rock beats (breaks) Scissors, Scissors beats (cuts) Paper, and Paper beats (covers) Rock. The program should do error handling on the input values and require the Player toenter R, P, S or Q (for quit). The program should accept both upper and lower case letters. The program output should look like the example output in the last section, including spacing and error handling.

Other Requirements 1. The program must use at least three functions, excluding the flushScanf function provided below, with appropriate parameters and return values in addition tomain. 2. Make sure that your project is organized with function declarations, then the main function, then the other functions. 3. You must not use global variables. 4. The program must use at least one while or for loop. 5. The program must use at least one switch statement. 6. The program must use at least one if...else if...elsemulti-way statement. 7. The program must randomly choose the computers choice or R, P, or S. 8. Avoid the use of hard coded numbers. Use constants instead.

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!