Question: I need to add a statement for if the user inputs something that is not R, P, or S and prints Not a legal move!

I need to add a statement for if the user inputs something that is not R, P, or S and prints "Not a legal move!" I have attached my code. C programming!I need to add a statement for if the user inputs somethingthat is not R, P, or S and prints "Not a legalmove!" I have attached my code. C programming! #include #include int main()

#include #include int main() { int randSeed; int numGames; int userScore=0; int compScore=0; char userChoice; int tieScore=0; char comp; printf("Starting the CPSC 1011 Rock, Paper, Scissors Game! "); printf("Enter a random seed between 0 - 100:"); scanf("%d", &randSeed); srand (randSeed); printf(" Enter the number of matches to play: "); scanf("%d", &numGames); for(int i=0; i0){ printf(" You-%d ", userScore); } if(compScore>0){ printf(" Computer-%d ", compScore); } if(tieScore>0){ printf("Ties-%d ", tieScore); } } printf(" The game of %d matches is complete. The final scores are: ", numGames); printf("You: %d ", userScore); printf("Computer: %d ", compScore); printf("Ties: %d ", tieScore); return(0); }

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!