subject

For Java "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 22:20
Pp 4.1 design and implement a class called sphere that contains instance data that represents the sphere’s diameter. define the sphere constructor to accept and initialize the diameter and include getter and setter methods for the diameter. include methods that calculate and return the volume and surface area of the sphere (see pp 3.5 for the formulas). include a tostring method that returns a one-line description of the sphere. create a driver class called multisphere, whose main method instantiates and updates several sphere objects.
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The camera still is bad even with the new iphone xr and especially in low light it is even worst because you can see the pixels more if its in low light. if all you apple customers want apple to fix this then lets fill there feedback with complaints about the
Answers: 1
question
Computers and Technology, 25.06.2019 08:10
The __ is the section of a cpu core that performs arthimetic involving integers and logical operations
Answers: 2
question
Computers and Technology, 25.06.2019 10:30
Tools used in a particular career depend on the tasks performed. true or false
Answers: 1
You know the right answer?
For Java "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B,...
Questions
question
Mathematics, 13.11.2020 19:50
question
Mathematics, 13.11.2020 19:50
question
Mathematics, 13.11.2020 19:50
question
Physics, 13.11.2020 19:50
Questions on the website: 13722361