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]
3 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]3 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 15.00 mL sample of a solution of H2SO4 of unknown concentration was titrated with 0.3200M NaOH. the titration required 21.30 m
natima [27]

Answer:

a. 0.4544 N

b. 5.112 \times 10^{-5 M}

Explanation:

For computing the normality and molarity of the acid solution first we need to do the following calculations

The balanced reaction

H_2SO_4 + 2NaOH = Na_2SO_4 + 2H_2O

NaOH\ Mass = Normality \times equivalent\ weight \times\ volume

= 0.3200 \times 40 g \times 21.30 mL \times  1L/1000mL

= 0.27264 g

NaOH\ mass = \frac{mass}{molecular\ weight}

= \frac{0.27264\ g}{40g/mol}

= 0.006816 mol

Now

Moles of H_2SO_4 needed  is

= \frac{0.006816}{2}

= 0.003408 mol

Mass\ of\ H_2SO_4 = moles \times molecular\ weight

= 0.003408\ mol \times 98g/mol

= 0.333984 g

Now based on the above calculation

a. Normality of acid is

= \frac{acid\ mass}{equivalent\ weight \times volume}

= \frac{0.333984 g}{49 \times 0.015}

= 0.4544 N

b. And, the acid solution molarity is

= \frac{moles}{Volume}

= \frac{0.003408 mol}{15\ mL \times  1L/1000\ mL}

= 0.00005112

=5.112 \times 10^{-5 M}

We simply applied the above formulas

4 0
3 years ago
Explain how potential energy converts to kinetic energy in the loop-the-loop section of the roller coaster. Make sure to note wh
larisa86 [58]

Answer:

lol

Explanation:

8 0
3 years ago
Select the correct answer. which process involves creating a product by heating metals and changing their shape through the appl
Paraphin [41]

Answer:

I would say that it is forming.

Explanation:

Give brainliest if u can. :S

4 0
3 years ago
Select four geometric shapes that are commonly used by engineers in their designs.
stealth61 [152]

Answer:

Arc ,sphere ,line ,prism

Explanation:

  • Arc is used for semicircular or short term projects
  • Sphere is used for design of spherical surfaces or projects
  • Prism is used for creating buliding designs
  • Lines are especially used for creating roads, flyover design
3 0
2 years ago
Who is Robert Goldard
balu736 [363]

Answer:

An am American engineer

8 0
3 years ago
Read 2 more answers
Other questions:
  • A frustum of cone is filled with ice cream such that the portion above the cone is a hemisphere. Define the variables di=1.25 in
    9·1 answer
  • The density of a fluid is given by the empirical equation rho 70:5 exp 8:27 107 P where rho is density (lbm/ft3 ) and P is press
    6·1 answer
  • In a simple ideal Rankine cycle, water is used as the working fluid. The cycle operates with pressures of 2000 psi in the boiler
    7·1 answer
  • 500 flights land each day at San Jose’s airport. Assume that each flight has a 5% chance of being late, independently of whether
    5·1 answer
  • # 17
    13·2 answers
  • The conditions at the beginning of compression in an Otto engine operating on hot-air standard with k=1.35 and 101.325 kPa, 0.05
    10·1 answer
  • Everyone has only one learning style. True or false? hurry pleasle this exp carees class
    11·1 answer
  • The MOST common injury causing absence from work is
    7·2 answers
  • Close to 16 billion pounds of ethylene glycol (EG) were produced in 2013. It previously ranked as the twenty-sixth most produced
    8·1 answer
  • In surveying , supposing we can not pull the tape because it is passing through a shallow river. What will i do to obtain an acc
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!