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, 24.06.2019 04:30
What is the process in which the software development team compiles information to determine the final product
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
Which two technologies support the building of single-page applications?
Answers: 2
question
Computers and Technology, 24.06.2019 18:30
In what way is your social media footprint related to your digital id
Answers: 1
question
Computers and Technology, 24.06.2019 23:50
What is your fav video game currently: a) roblox b) fortnite c) apex legends d) pubg
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, 25.01.2021 22:40
question
Mathematics, 25.01.2021 22:40
question
Computers and Technology, 25.01.2021 22:40
question
Mathematics, 25.01.2021 22:40
question
Mathematics, 25.01.2021 22:40
Questions on the website: 13722359