Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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!image text in transcribedimage text in transcribedimage text in transcribed

#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

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

Recommended Textbook for

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions

Question

What is the difference between a licensor and a licensee?

Answered: 1 week ago