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.
Answer:
18 teeth/inch
Explanation:
Given that: i. driver gear has 8 teeth and diametral pitch of 6 teeth/inch.
ii. follower gear has 24 teeth.
Let the followers diametral pitch be represented by x.
Then,
8 teeth ⇒ 6 teeth/inch
24 teeth ⇒ x teeth/inch
So that;
x = 
= 
= 18 teeth/inch
The diametral is 18 teeth/inch
Answer:
0.4 gallons per second
Explanation:
A function shows the relationship between an independent variable and a dependent variable.
The independent variable (x values) are input variables i.e. they don't depend on other variables while the dependent variable (y values) are output variables i.e. they depend on other variables.
The rate of change or slope or constant of proportionality is the ratio of the dependent variable (y value) to the independent variable (x value).
Given that the garden hose fills a 2-gallon bucket in 5 seconds. The dependent variable = g = number of gallons, the independent variable = t = number of seconds.
Constant of proportionality = g / t = 2 / 5 = 0.4 gallons per second