Question: this is lab3 solution, help please! Project 2 Rock, Paper, Scissors Updated Take the solution to Lab 3 and make sure the user enters a

 this is lab3 solution, help please! Project 2 Rock, Paper, Scissors

this is lab3 solution, help please!

Updated Take the solution to Lab 3 and make sure the user

Project 2 Rock, Paper, Scissors Updated Take the solution to Lab 3 and make sure the user enters a letter of R, P, or S and the computer generates a number between 0-2 and changes that number to a letter of R, P or S, using a switch. Make sure the user knows why he/she has won or lost-print a message like "Paper covers Rock" or "Scissors cuts Paper". Ask the user how many times he/she wants to play and incorporate that into a for loop or allow the user to keep playing until he/she says to stop using a do-while loop. Add the code to count how many wins, losses and ties that the user has and print the results at the end of the program before stopping the program. Allow the user to exit a game, not the program, if he wants to-use a code of 'X' Also keep a count of exits from a game. Make sure your run has at least one exit. Also have the program determine if a user did not type in R, P, S or X and print "Bad Code" and allow the user to continue the game. Run at least once with a "Bad Code" iqstream> time.h> #inc #include using namespace std; int main() // Generate a random value between 0-2 srand(time(0)); I/ Seed the time int program LValue-rand()%(3); char converted value char user value; // Convert computer value switch(program_value) case 0: converted value-'S' break case 1: converted value-'R' break; case 2 convertedvalue- break; - // Ask user to enter- S,R,P cout>user value; // Validate if user entered only S,R,P // Check who worn if(converted value-- 'S' && user_value 'S')

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!