An automated irrigation controller regulates water flow through a greenhouse manifold.
1 # ----- Calibration Constants -----
2 VALVE_COEFFICIENT = 1.42
3
4 # ----- Helper Functions -----
5 def compute_flow_rate(pressure_psi):
6 return pressure_psi * VALVE_COEFFICIENT
7
8 # ----- Execution Flow -----
9 system_pressure = float(input("Enter current manifold pressure (PSI): "))
10 target_flow = compute_flow_rate(system_pressure)
11 print("Calculated discharge rate: ", target_flow, "L/s")
State the name of the computational thinking technique demonstrated by hiding the complex mechanical details of the valve's internal friction and chamber geometry, and instead representing it solely by the simplified input-output relationship in the compute_flow_rate subprogram.
19 exam-style questions on Edexcel GCSE Computer Science Decomposition and abstraction, covering Benefits of decomposition and abstraction and Benefits of subprograms. Each one has a worked solution and a mark scheme showing where the marks go.