Your train leaves Leeds at 10:14 and arrives at 10:23. What should a timer show?
Your train leaves Leeds at ten fourteen and arrives at ten twenty-three. You can work out the journey time in your head. How could you write steps that a computer could follow for any journey that starts and ends in the same hour?
Both times are in the same hour. Keeping just their minute numbers is abstraction. Follow the arrows from Start: read the start and finish minutes, subtract start from finish, display the result, then stop. Splitting the job into input, processing and output is decomposition.
The first two lines store your inputs in variables called start and finish. Each variable has a name and can hold a value. Next, calculate finish minus start. The arrow points to elapsed, the variable that receives the result. That's assignment. The last line displays the value in elapsed.
Look at the calculation line on its own. Say you already have values for finish and start. Where will the result of the subtraction be stored? Pick the variable that receives it.
An algorithm is a step-by-step method for solving a problem. This Python three program implements that method. On each input line, input reads text, int converts it to an integer and the equals sign assigns it. The subtraction stays the same, and print displays the stored result.
Try the Leeds journey in both versions. The first input stores fourteen in start. The second stores twenty-three in finish. Subtract fourteen from twenty-three to get nine, then store nine in elapsed. Both versions display nine, so the journey took nine minutes.
Now use eighteen as the start minute and thirty as the finish minute. Trace the program in the same order. What number will the final line display? Pick an answer.
Each row shows the stored values after that line runs. Unset means no value has been assigned yet. Start gets eighteen on line one and stays there when finish gets thirty. Line three stores twelve in elapsed. Line four prints twelve without changing any stored values.
Compare the two ways of writing the calculation and output. Both tell you to subtract start from finish and display the result. A person can follow the English on the left. With the inputs already stored, Python can run the two lines on the right.
Read the instruction before you write. If it asks for Python, give runnable Python. If it asks for AQA pseudo-code, use the assignment arrow when storing a value. If it asks for the purpose, explain that the algorithm finds how many minutes pass between two times in the same hour.