subject

SOLVE IN C: "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequence. Create a for loop that compares the two strings starting from index 0. For each match, add one point to userScore. Upon a mismatch, exit the loop using a break statement. Assume simonPattern and userPattern are always the same length. Ex: The following patterns yield a userScore of 4:

simonPattern: RRGBRYYBGY
userPattern: RRGBBRYBGY
please use comments to explain each step!! I would like to understand the process :)

#include
#include

int main(void) {
char simonPattern[50];
char userPattern[50];
int userScore;
int i;

userScore = 0;

scanf("%s", simonPattern);
scanf("%s", userPattern);

**YOUR ANSWER GOES HERE**

printf("userScore: %d\n", userScore);

return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
At an open or uncontrolled intersection, yield if a. your road is paved and the crossroad is not b. the cross road is paved and yours is not c. you have two or more passengers in your vehicle d. you did not yield in the last intersection
Answers: 1
question
Computers and Technology, 22.06.2019 09:30
What are the steps involved in accepting all the changes in a document? arrange these in order click edit. click accept or reject. click changes. click accept all.
Answers: 1
question
Computers and Technology, 22.06.2019 14:30
If the polar bear were taken out of the food chain what would happen to the seal population the seal population would diminish the seal population would grow dramatically the seal population would stay the same the seal population would decrease slightly
Answers: 1
question
Computers and Technology, 22.06.2019 18:30
List the five on-board vehicle subsystems
Answers: 1
You know the right answer?
SOLVE IN C: "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B...
Questions
question
Mathematics, 05.07.2019 08:10
question
Mathematics, 05.07.2019 08:10
question
Mathematics, 05.07.2019 08:10
question
Mathematics, 05.07.2019 08:10