2
0/3

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.

Algorithm

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

Trace Table

Complete the table below to show the outputs for each set of input values.

Input value for guestsInput value for travelDistanceOutput
15050
3040
20015
[3]

Representing algorithms Questions

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.

PreviousNext

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms