Question: Create a project called Daily10. Add a C source file to the project named daily10.c. Write a program to score the paper-rock-scissors game. Each of

Create a project called Daily10. Add a C source file to the project named daily10.c.

Write a program to score the paper-rock-scissors game. Each of two players enters 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 Draw, nobody wins. The players must be able to enter either upper- or lower-case letters. If an invalid choice is entered, the player should be permitted to re-enter his choice immediately (before the other player is given a chance to enter their value). The program must allow the players to continue playing as long as desired by asking them after each game if they would like to play again.

For this assignment you MUST use a function to get the input value for the players choice. The function MUST return an enumerated type called Choice that has three values, ROCK, PAPER, and SCISSORS. This makes it so that the only part of your program that pertains to the player choices that can involve character variables is the input portion. The rest of your program should always use variables of the enumerated Choice type and the end result should be that your program is easier to read. Your program output should look something like the following:

Create a project called Daily10. Add a C source file to the

it is your turn ayer Please enter yourchoice (p)aper, (r)ock, or (s)cissors why I'm sorry, I do not understand Please enter yourchoice (p)aper, (r)ock, or (s)cissors: 42 I'm sorry, I do not understand Please enter your choice (p)aper, (r)ock, or (s cissors: Paper Player-2 it is your turn! Please enter your choice (p)aper, (r)ock, or (s)cissors: r Player-1 wins! Paper covers rock Do you wish to continue? (y): y Player-1 it is your turn! Please enter your choice (p)aper, (r)ock, or (s cissors: s Player-2 it is your turn! Please enter your choice (p)aper, (r)ock, or (s cissors: ROCK on! Player-2 wins! Rock breaks scissors Do you wish to cont inue? (y): n Press any key to continue - 2

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!