1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
UkoKoshka [18]
4 years ago
10

"Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user must repeat the sequen

ce. 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;
}
}
Computers and Technology
1 answer:
kotykmax [81]4 years ago
5 0

Answer:

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

       for(i=0 ; i<simonPattern.length(); i++)

       {

           if(simonPattern.charAt(i)==userPattern.charAt(i))

           {

               userScore+=1;

           }

           else

           {

               break;

           }

           

           

       }

       System.out.println("userScore: " + userScore);

 

    }

}

Explanation:

the string method charAt() is used to access each character of the string.

You might be interested in
PLEASEEEE HELPP ILL MARK BRAINLIEST!! in a presentation outline, each slide must represent a main point in the outline. true or
patriot [66]

Answer: true

Explanation: hope this helps

6 0
3 years ago
What is typeface
Mademuasel [1]
I’m so bored and hungry answer is c 3566
4 0
3 years ago
Read 2 more answers
In which situation is coauthoring of presentations primarily utilized?
Tanya [424]

Answer:

A i belive

Explanation:

3 0
3 years ago
Read 2 more answers
Dress4Win has asked you to recommend machine types they should deploy their application servers to.
tensa zangetsu [6.8K]

Answer:

Option A is the correct option.

Explanation:

Because Dress4Win is the online web organization that asked to the consultant to advice that type of machines that they want to expand their server for those application which perform the work of the mapping on the basis of the premises physical hardware cores and also in the clouds softwares that is nearest machines types of RAM.

7 0
3 years ago
_____ changes all occurrences of misspelled words in a document.
guajiro [1.7K]

Answer:

My answer is C.

4 0
3 years ago
Other questions:
  • Which one is it A,B,C,D
    10·2 answers
  • The Maui coffee shop sells coffee at $10.50 a pound plus the cost of shipping. Each order ships for $0.86 per pound + $1.50 fixe
    14·1 answer
  • Is a network where connected devices are located within the same building.
    5·2 answers
  • can Results shown at the top of the Google search engine results page (SERP) always get high Needs Met ratings
    10·1 answer
  • Making an analogy between Freudian theory and the brain networks described in an earlier chapter in the text, primary process th
    10·1 answer
  • One example of a <br> is the length of a car.
    7·1 answer
  • What is the last phase of the website development process?
    10·2 answers
  • select the correct answer from each drop-down menu. “To clean a computer screen, use ___. To clean a keyboard, use a ___.”
    7·1 answer
  • I will give brainliest to the best answer. what is a good screen recorder
    11·1 answer
  • What is the output of the code? (CHECK IMAGE)
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!