Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For some reason when creating this rock, paper, scissors program, no matter what I input the computer always chooses paper. And the results of the

image text in transcribed

image text in transcribed

image text in transcribed

For some reason when creating this rock, paper, scissors program, no matter what I input the computer always chooses paper. And the results of the game are always "You Tied" even when it is clear that the user has beaten the computer. Is there any way to fix this?

int main (void) int numMatches; I number of matches that will be played / int roundMatch; II current round number that is being played int compChoice; // the choice of "rock, paper, or scissors that the computer will make // char userChoice; // the choice of "rock, paper, or scissors that the user will make // int R; // rock int P; I/ paper11 int S; 1/ scissors 11 printf("Starting the CPSC 1011 Rock, Paper, Scissors Game!n"); printf("Enter the number of matches to play:") scanf(" %d", &nunMa tches); numMatches nunMatches + 1; compChoice- (rand() % 3) ;; // to 2 // P-1; for (roundMatch# 1; roundMatch

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

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

What types of accounts are kept in the accounts payable ledger?

Answered: 1 week ago