A catering company uses an automated algorithm to calculate the booking cost for private events based on the number of guests and the travel distance to the venue.
guests ← USERINPUT
travelDistance ← USERINPUT
setupFee ← 120
IF guests > 150 THEN
baseCost ← guests * 15
ELSE
IF guests ≥ 80 THEN
baseCost ← guests * 18
ELSE
baseCost ← guests * 25
ENDIF
ENDIF
totalCost ← baseCost + (travelDistance * 4)
IF totalCost < 1000 THEN
totalCost ← totalCost + setupFee
ENDIF
OUTPUT totalCost
Complete the table below to show the outputs for each set of input values.
Input value for guests | Input value for travelDistance | Output |
|---|---|---|
| 150 | 50 | |
| 30 | 40 | |
| 200 | 15 |
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.