An algorithm is represented in the pseudocode below.
numHoodies ← USERINPUT
numEmbroidery ← USERINPUT
deliverySurcharge ← 25
IF numHoodies > 50 THEN
totalCost ← numHoodies * 15
ELSE
IF numHoodies ≥ 20 THEN
totalCost ← numHoodies * 18
ELSE
totalCost ← numHoodies * 22
ENDIF
ENDIF
totalCost ← totalCost + (numEmbroidery * 8)
IF totalCost < 500 THEN
totalCost ← totalCost + deliverySurcharge
ENDIF
OUTPUT totalCost
Complete the table below to show the outputs of the algorithm.
Input value for numHoodies | Input value for numEmbroidery | Output |
|---|---|---|
| 50 | 12 | |
| 15 | 10 | |
| 20 | 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.