Two runners in a school race finish together. How should the results screen decide?
At your school sports day, two runners get the same time. The results screen needs to show a tie. How could you draw a set of instructions that tells it what to do when the times match and when they don't?
Read the two times as your input. To process them, subtract the lower time from the higher time. Then display the gap as your output. An algorithm is a sequence of steps for solving a problem. A program implements those steps in code a computer can run.
Begin at the rounded Start symbol. Follow the arrow to the slanted input box, called a parallelogram, where you read the times. The rectangle shows the processing step: find the gap. Display the gap in another parallelogram, then follow the arrow to the rounded End symbol.
You're drawing the instruction that works out the gap between the two times. Which symbol should hold that instruction? Pick the shape that matches what the step does.
Keep the times and leave out names. That's abstraction. Split the job into smaller tasks, like calculating the gap. That's decomposition. With the times already stored in high and low, compare the pseudocode and Python. Both subtract low from high, store the gap, then display it.
From Start, read the two times and find the gap. The diamond asks whether the gap equals zero. Follow Yes to display Tie, or No to display No tie. Look where the two routes join before End. The diamond is a decision symbol: its answer tells you which exit to take.
With two times of fifteen seconds, subtract fifteen from fifteen to get zero. Follow Yes, display Tie, then reach End. Now take fifteen and eighteen seconds. Subtract fifteen from eighteen to get three seconds. Three isn't zero, so follow No, display No tie, and reach End.
Now the two runners both finish in thirteen seconds. Work out the gap and use it to answer the question in the diamond. Pick the route that takes you from the decision all the way to End.
Both exits can have the right labels and still leave you with an incomplete flowchart. On the left, the No route displays No tie and has no arrow out. On the right, both outputs connect to End, so you can follow either route all the way.
If the exam says ‘Complete the trace table’, use one row per run here. Record the input times, work out the gap, answer the decision, then write the output. For ‘State the purpose of the algorithm’, inspect the two messages. They tell you whether the recorded times are equal.