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 |
Practise AQA GCSE Computer Science Representing algorithms with exam-style questions for GCSE Computer Science. 100 questions, matched to the AQA GCSE Computer Science (8525) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.