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:
a) 0.489
b) 54.42 kg/s
c) 247.36 kW/s
Explanation:
Note that all the initial enthalpy and entropy values were gotten from the tables.
See the attachment for calculations
Answer:
23.3808 kW
20.7088 kW
Explanation:
ρ = Density of oil = 800 kg/m³
P₁ = Initial Pressure = 0.6 bar
P₂ = Final Pressure = 1.4 bar
Q = Volumetric flow rate = 0.2 m³/s
A₁ = Area of inlet = 0.06 m²
A₂ = Area of outlet = 0.03 m²
Velocity through inlet = V₁ = Q/A₁ = 0.2/0.06 = 3.33 m/s
Velocity through outlet = V₂ = Q/A₂ = 0.2/0.03 = 6.67 m/s
Height between inlet and outlet = z₂ - z₁ = 3m
Temperature to remains constant and neglecting any heat transfer we use Bernoulli's equation

Work done by pump

∴ Power input to the pump 23.3808 kW
Now neglecting kinetic energy

Work done by pump

∴ Power input to the pump 20.7088 kW
Answer:
526.5 KN
Explanation:
The total head loss in a pipe is a sum of pressure head, kinetic energy head and potential energy head.
But the pipe is assumed to be horizontal and the velocity through the pipe is constant, Hence the head loss is just pressure head.
h = (P₁/ρg) - (P₂/ρg) = (P₁ - P₂)/ρg
where ρ = density of the fluid and g = acceleration due to gravity
h = ΔP/ρg
ΔP = ρgh = 1000 × 9.8 × 7.6 = 74480 Pa
Drag force over the length of the pipe = Dynamic pressure drop over the length of the pipe × Area of the pipe that the fluid is in contact with
Dynamic pressure drop over the length of the pipe = ΔP = 74480 Pa
Area of the pipe that the fluid is in contact with = 2πrL = 2π × (0.075/2) × 30 = 7.069 m²
Drag Force = 74480 × 7.069 = 526468.1 N = 526.5 KN