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. ex: the following patterns yield a userscore of 4: simonpattern: r, r, g, b, r, y, y, b, g, y

import java. util. scanner;

public class simonsays {
public static void main (string [] args) {
string simonpattern = "";
string userpattern = "";
int userscore = 0;
int i = 0;

userscore = 0;
simonpattern = "rrgbryybgy";
userpattern = "rrgbbrybgy";

system. out. println("userscore: " + userscore);

return;
}
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 05:00
In cell b18, enter a formula to calculate the amount budgeted for meals. this amount is based on the daily meal allowance and the total travel days (# of nights+1).
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
For positive constants a and b, the force between two atoms in a molecule is given f(r) = −a r2 + b r3 , where r > 0 is the distance between the atoms. note: a and b are upper case letters. (a) find f '(r) = (b) find the critical point for f(r). r = (c) find f ''(r) = (d) find the value of r so that f ''(r) = 0.
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
What shows the web address of the page that is currently displayed in the workspace? status window toolbar location bar internet box
Answers: 1
question
Computers and Technology, 24.06.2019 12:10
What is it called during the editing process when the processor ensures that a character holding a coffee mug from one angle is holding the same mug in the same way when the shot switches to another camera at another angle? cinematography continuity technology prop use
Answers: 1
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, 02.02.2021 01:00
question
Mathematics, 02.02.2021 01:00
question
Mathematics, 02.02.2021 01:00
question
Mathematics, 02.02.2021 01:00
question
Mathematics, 02.02.2021 01:00
question
Mathematics, 02.02.2021 01:00
question
Mathematics, 02.02.2021 01:00
Questions on the website: 13722359