Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain the principle of Blue Ocean Strategy.

Answered: 1 week ago