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
New ventures that are based on strategic value, such as valuable technology, are attractive while those with low or no strategic
Alecsey [184]

Answer:

false

Explanation:

i hope answer is right

7 0
2 years ago
Read 2 more answers
Which of the following activities can help expand engineers' creative thinking capabilities?
Assoli18 [71]

Answer:

team building exercises

Explanation:

3 0
2 years ago
Read 2 more answers
The notation on one's license that the person must wear glasses
madam [21]

Answer:

final.

Explanation:

''.''

4 0
3 years ago
The components of an electronic system dissipating 180 W are located in a 1-m-long horizontal duct whose cross section is 16 cm
oee [108]

Answer:

a) The exit temperature is 39.25°C

b) The highest component surface is 132.22°C

c) The average temperature for air equal to 35°C is a good assumption because the air temperature at the inlet will increase due to the result in the heat gain produced by the duct and whose surface is exposed to a flow of hot.

Explanation:

a) The properties of the air at 35°C:

p = density = 1.145 kg/m³

v = 1.655x10⁻⁵m²/s

k = 0.02625 W/m°C

Pr = 0.7268

cp = 1007 J/kg°C

a) The mass flow rate of air is equal to:

m=\rho *V = 1.145*0.65=0.7443kg/min=0.0124kg/s

The exit temperature is:

T=T_{i} +\frac{Q}{m*c_{p} } =27+\frac{0.85*180}{0.0124*1007} =39.25°C

b) The mean fluid velocity is:

V_{m} =\frac{V}{A} =\frac{0.65}{0.16*0.16} =25.4m/min=0.4232m/s

The hydraulic diameter is:

D_{h} =\frac{4A}{p} =\frac{4*0.16*0.16}{4*0.16} =0.16m

The Reynold´s number is:

Re=\frac{VD_{h} }{v} =\frac{0.4232*0.16}{1.655x10^{-5} } =4091.36

Assuming fully developed turbulent flow, the Nusselt number is:

Nu=0.023Re^{0.8} *Pr^{0.4} =0.023*4091.36^{0.8} *0.7268^{0.4} =15.69

h=\frac{k*Nu}{D_{h} } =\frac{0.02625*15.69}{0.16} =2.57W/m^{2} C

The highest component surface temperature is:

T=T_{e} +\frac{\frac{Q}{A} }{h} =39.2+\frac{0.85*\frac{180}{4*0.16*1} }{2.57} =132.22°C

6 0
3 years ago
How do scientists and engineers use math to help them?
VikaD [51]
Math (e.g., algebra, geometry, calculus, computer computation) is used both as a tool to create mathematical models that describe physical phenomena and as a tool to evaluate the merit of different possible solutions. ... In engineering, math and science are tools used within the engineering design process.
Biologists use math as they plot graphs to help them understand equations, run small “trial and error” tests with some sample numbers when developing algorithms, and use the R project for analyzing protein sequences and structures. Electrical engineers use math in many ways in their career. They use math to help design and test electrical equipment. They use math to calculate amp and volt requirements for electrical projects. They use math in creating computer simulations and designs for new products.
7 0
3 years ago
Other questions:
  • Technician A says diesel engines are also called compression ignition engines. Technician B says diesel engines have much higher
    9·1 answer
  • A hydrogen-filled balloon to be used in high altitude atmosphere studies will eventually be 100 ft in diameter. At 150,000 ft, t
    7·1 answer
  • Two satellites A and B are orbiting the earth around the equator, E, at different altitudes on a circular path of 2400km and 300
    8·1 answer
  • IN JAVA,
    6·1 answer
  • A 26-tooth pinion rotating at a uniform 1800 rpm meshes with a 55-tooth gear in a spur gear reducer. Both pinion and gear are ma
    11·1 answer
  • Help pls I don’t understand the question.
    9·1 answer
  • Select the correct answer.
    6·1 answer
  • ¿Cómo llevan a cabo el lavado ropa?​
    8·1 answer
  • Policeman says, "Son, you can't stay here"
    9·1 answer
  • Write a program that takes three numbers as input from the user, and prints the largest.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!