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, 22.06.2019 18:30
List the five on-board vehicle subsystems
Answers: 1
question
Computers and Technology, 23.06.2019 19:00
Choose the correct citation for the case which established the "minimum contacts" test for a court's jurisdiction in a case. select one: a. brown v. board of education of topeka, 347 u.s. 483 (1954). b. international shoe co. v. washington, 326 u.s. 310 (1945) c. haynes v. gore, 531 u.s. 98 (2000). d. international shoe co. v. washington, 14 u.s. code 336.
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
How can you make your column headings stand out?
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
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, 16.07.2019 05:30
question
Mathematics, 16.07.2019 05:30
question
Mathematics, 16.07.2019 05:30
question
Mathematics, 16.07.2019 05:30
Questions on the website: 13722360