Your GAA club's bus has a €2 booking fee and €3 tickets. What should the app do first?
Your GAA club is running a bus to a match. There's one two euro fee per booking, and each ticket costs three euro. When you book three tickets, what does the app need to know before it can show your total fare?
If you book three seats, your ticket count is three. If you book four seats, it’s four. The value changes from one booking to the next, but the name stays the same. Use tickets whenever an instruction needs that count.
Watch a booking move through the app. You enter three tickets first. The app multiplies three by three, then adds the two euro booking fee to get eleven. Once it has that result, it can display eleven euro.
The app needs the ticket count to calculate the fare, and the customer needs to see the calculated total. Pick the order that makes sure each value is ready when it's needed.
In this algorithm, you follow the instructions in order, from top to bottom. That’s sequence. You can write those instructions in pseudocode, which means stating exactly what to do without having to use the syntax of a particular programming language.
First, read three into tickets. On the assignment line, use that value: three times three is nine, and adding the two euro fee gives eleven. The left arrow tells you to store eleven in fare. Finally, output fare to display eleven.
Use the same pseudocode for a booking of four tickets. Each ticket costs three euro and the two euro booking fee is charged once. Pick the value that the output instruction displays.
A line that just says calculate fare leaves out the rule. You can't trace it from the ticket count alone. The assignment on the right tells you exactly what to multiply, what to add, and where to store the result.
Test the same algorithm in Python by entering four. Input reads what you type as text, and int converts it to a whole number. The next line calculates and stores the fare. Print displays fourteen, just as you predicted in your trace.