An algorithm is shown in the pseudocode below.
numStudents ← USERINPUT
numCoaches ← USERINPUT
bookingFee ← 15
IF numStudents > 80 THEN
ticketCost ← numStudents * 6
ELSE
IF numStudents ≥ 40 THEN
ticketCost ← numStudents * 8
ELSE
ticketCost ← numStudents * 10
ENDIF
ENDIF
totalCost ← ticketCost + (numCoaches * 150)
IF totalCost < 1000 THEN
totalCost ← totalCost + bookingFee
ENDIF
OUTPUT totalCost
Complete the table below to show the outputs for each of the given test runs.
| Run | numStudents | numCoaches | Final Output (totalCost) |
|---|---|---|---|
| 1 | 30 | 2 | [A] |
| 2 | 50 | 5 | [B] |
| 3 | 100 | 3 | [C] |
208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.