You ran for 18 seconds and finished at 58 on the clock. When did you start?
At a school sports day in Leeds, the race clock is already running when you start. You finish at fifty-eight seconds on that clock, but your result says eighteen seconds. Can you work out what the clock showed when you started?
You can break the timing problem into smaller tasks: read the clock, calculate the time taken and show the result. That’s decomposition. Abstraction means keeping only the details you need. Keep the start and finish readings from the same clock. You don’t need the runner’s lane number.
Follow the arrows from Start. The timer reads twenty-five seconds at the start and forty-one at the finish. Those are the inputs. It subtracts twenty-five from forty-one. That’s processing. It sends sixteen seconds to the display as the output, then this run ends.
This time the clock reads ten seconds at the start and twenty-four seconds at the finish. The timer subtracts the start reading from the finish reading and displays the result. Pick the option that gives the output.
An algorithm is a clear sequence of steps for solving a problem. You’ve seen these steps as a flowchart. In pseudocode, read both values, store finish minus start as elapsed, then output it. The Python program implements those steps. It reads whole seconds and prints the elapsed time.
Read across the trace table to follow the program. With twenty-five and forty-one as inputs, it stores sixteen in elapsed and prints sixteen. With thirty and forty-seven, it stores and prints seventeen. The code shows why: finish minus start gives the time the runner took.
Back at sports day, fifty-eight seconds minus the start reading equals eighteen seconds. The start must be eighteen seconds before the finish, so subtract eighteen from fifty-eight to get forty seconds. Check by subtracting forty from fifty-eight. You get the displayed time of eighteen seconds.
Now try another result. The finish reading is seventy-two seconds and the timer displays twenty-five seconds elapsed. Use the displayed time to work back to the start reading. Pick the reading you get.
A common slip is to label the subtraction as output. Look at the calculation: forty-one minus twenty-five works on the two inputs, so it’s processing. Now look at what the timer actually displays. The sixteen seconds shown to the runner is the output.
If the question says explain why the subtraction is processing, give a reason as well as a label. You could write that subtracting the start reading from the finish reading uses the two input values to calculate the elapsed time.