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
Nady [450]
4 years ago
10

4.10.1: Simon says. "Simon Says" is a memory game where "Simon" outputs a sequence of 10 characters (R, G, B, Y) and the user mu

st 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. Assume simonPattern and userPattern are always the same length. Ex: The following patterns yield a userScore of 4: simonPattern: RRGBRYYBGY userPattern: RRGBBRYBGY
Engineering
1 answer:
AleksandrR [38]4 years ago
5 0

Answer:

for  i  in range(0,10):

   if SimonPattern[i] == UserPattern[i]:

       score = score + 1

       i = i + 1

   else:

       break

if i == 9:

   score = score + 1    

print("Total Score: {}".format(score))

Explanation:

This for loop was made using Python. Full code attached.

  • For loop requires a range of numbers to define the end points. For this Simon Says game, we are talking about 10 characters, so that must be the range for the for loop: from 0 to 10.
  • Conditional if  tests if Simon pattern matches User's one characheter by one and add point for each match.
  • Break statement is ready to escape the for loop at first mismatch.
  • As we are starting from index 0, if the users matched all the characters correctly, then we need to add 1, otherwise the maximun score would be 9 and it should be 10.
Download txt
You might be interested in
A guy named Kirby Had touched only a gear on the projector. Yet there was a out of the blue rip. Kirby did not mind at all and s
solong [7]

The guy named Kirby didn't touch the power button on the projector. If he touched means the projector will work fine.

<u>Explanation</u>:

  • Kirby touched the gear on the projector. He should check the projector carefully before operating the projector. But he didn't check properly.
  • There was a blue rip in the projector. Kirby fails to notice the blue rip. Without minding that he has started the projector. So the tape and the projector is not working well.
  • He should fix the blue rip and he should press the start button in the projector. The mistake is he didn't do that. This is the thing that made the projector ripped.                                                                                                                                                                  

                           

7 0
3 years ago
For a metal that has a yield strength of 690 MPa and a plane strain fracture toughness (KIc) of 32 MPa-m1/2, compute the minimum
Digiron [165]

Answer:

the minimum component thickness for which the condition of plane strain is valid is 0.005377 m or 5.38 mm

Explanation:

Given the data in the question;

yield strength σ_y = 690 Mpa

plane strain fracture toughness K_{Ic = 32 MPa-m^{1/2

minimum component thickness for which the condition of plane strain is valid = ?

Now, for plane strain conditions, the minimum thickness required is expressed as;

t ≥ 2.5( K_{Ic / σ_y )²

so we substitute our values into the formula

t ≥ 2.5( 32  / 690  )²

t ≥ 2.5( 0.0463768 )²

t ≥ 2.5 × 0.0021508

t ≥ 0.005377 m or 5.38 mm

Therefore,  the minimum component thickness for which the condition of plane strain is valid is 0.005377 m or 5.38 mm

7 0
3 years ago
Compression is maintained during combustion because on top of the motor is a _____
stealth61 [152]

Answer:

fan

Explanation:

7 0
3 years ago
According to the rules of dimension how should written notes appear
Arturiano [62]

Explanation:

Leaders for notes should be straight, not curved, and point to the center of circular  views of holes wherever possible. Leaders should slope at 45°, 30° or 60° with  horizontal but may be made at any convenient angle except vertical or horizontal.

7 0
3 years ago
__________ is not considered a driving distraction.
const2013 [10]

Answer: Focusing on the road

Explanation:

I know it and pls mark me as brainiest

3 0
3 years ago
Read 2 more answers
Other questions:
  • How do I quickly learn javascript?
    8·1 answer
  • Bananas are to be cooled from 28°C to 12°C at a rate of 1140 kg/h by a refrigerator that operates on a vapor-compression refrige
    6·1 answer
  • A current vehicle registration expires at _____ of the first owner listed on the registration form
    10·1 answer
  • What are the x and y coordinates of the centroid of the area?
    10·1 answer
  • If the power factor is corrected to 0.95 lagging, keeping the receiving end MVA constant, what will be the new voltage regulatio
    6·1 answer
  • To test the effects of a new fertilizer, 100 plots were divided in half. Fertilizer A is randomly applied to one half, and B to
    13·2 answers
  • Identify the part of the direct current motor​
    9·1 answer
  • A genetically engineered hormone,___________, can treat Mary’s child for growth hormone deficiencies by stimulating body growth
    7·1 answer
  • A 250-pound person would use a Type 1 ladder even if he were carrying a load with him. true or false
    5·1 answer
  • a) At a particular company, employees are rated at the end of each year. The rating scale begins at 0.0, with higher values indi
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!