Computers and Technology

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;
}
}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 15:30, jasssp
Write a program in plp assembly that counts up by one starting from zero (or one) inside a loop and writes this value to the leds every time the value is increased. the memory address of the leds is 0xf0200000. the table below shows the meaning and an example usage of the instructions covered in the video, plp instructions for project 1. instruction example usage meaning load immediate li $t0, 8 register $t0 is set to the value, 8. store word sw $t2, 0($t1) the value in register $t1 is used as the memory address. the value in register $t2 is copied into this memory address. add addiu $t4, $t3, 29 register $t4 is assigned the sum of 29 and the value in register $t3. jump j your_label_name the program jumps to the line following the label, "your_label_name: ". label your label name: defines a label called "your_label_name: " that can be jumped to
Answers: 2
image
Computers and Technology, 23.06.2019 19:30, bbgirl8638
Of the following pieces of information in a document, for which would you most likely insert a mail merge field?
Answers: 3
image
Computers and Technology, 24.06.2019 00:30, bsonicx
The best definition of an idiom is a. a word or phrase that describes a noun b. a word or phrase describing a verb c. a phrase containing figurative language in which the word expresses a different idea from its exact meaning d. a phrase that compares two unlike objects or ideas
Answers: 2
image
Computers and Technology, 24.06.2019 03:00, SiegeHatake4534
Will do anything for brainlest so can you guys me out i will try my best to you out
Answers: 1
Do you know the correct answer?
For Java "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B,...

Questions in other subjects:

Konu
Mathematics, 14.07.2021 17:20
Konu
Biology, 14.07.2021 17:20