subject

"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
public class SimonSays {
public static void main (String [] args) {
Scanner scnr = new Scanner(System. in);
String simonPattern;
String userPattern;
int userScore;
int i;

userScore = 0;

simonPattern = scnr. next();
userPattern = scnr. next();

/* Your solution goes here */

System. out. println("userScore: " + userScore);

return;
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 15:30
Melissa needs to add a topic to an email that she will send to her teacher. choose the name of the field where she should type her topic.
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
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
Answers: 2
question
Computers and Technology, 22.06.2019 22:20
Avariable of the data type arrays is storing 10 quantities. what is true about these quantities? a. the quantities all have different characteristics. b. the quantities all have the same characteristics. c. five quantities have the same and five have different characteristics. d. it is necessary for all quantities to be integers. e. it is necessary for all quantities to be characters.
Answers: 2
You know the right answer?
"Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the...
Questions
question
Mathematics, 01.09.2019 21:20
question
Mathematics, 01.09.2019 21:30
question
Social Studies, 01.09.2019 21:30
question
Mathematics, 01.09.2019 21:30
Questions on the website: 13722360