An automated deep-sea telemetry system logs sonar depth measurements during a research cruise.
# ----- Global Constants & State -----
SONAR_READINGS = [124.5, 128.2, 119.0, 131.4, 122.8]
# ----- Utility Functions -----
def processDepthData(readingsList):
cleaned = [r for r in readingsList if r > 0]
avg_depth = sum(cleaned) / len(cleaned)
variance = sum((x - avg_depth) ** 2 for x in cleaned) / len(cleaned)
standard_dev = variance ** 0.5
return round(standard_dev, 2)
# ----- Mission Control -----
mission_active = True
if mission_active:
dispersion = processDepthData(SONAR_READINGS)
print("Telemetry dispersion metric:", dispersion)
Identify the computational thinking technique employed when the mathematical complexity of cleaning data, calculating the variance, and computing the standard deviation is encapsulated within processDepthData(), thereby allowing the main mission control segment to retrieve the dispersion metric without managing these mathematical steps.
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.