An algorithm is shown in the pseudocode below.
numAcres ← USERINPUT
numDrones ← USERINPUT
serviceCharge ← 45
IF numAcres > 120 THEN
sprayCost ← numAcres * 12
ELSE
IF numAcres ≥ 60 THEN
sprayCost ← numAcres * 15
ELSE
sprayCost ← numAcres * 20
ENDIF
ENDIF
totalCharge ← sprayCost + (numDrones * 180)
IF totalCharge < 1500 THEN
totalCharge ← totalCharge + serviceCharge
ENDIF
OUTPUT totalCharge
Complete the table below to show the outputs for each of the given test runs.
| Run | numAcres | numDrones | Final Output (totalCharge) |
|---|---|---|---|
| 1 | 40 | 2 | [A] |
| 2 | 80 | 4 | [B] |
| 3 | 150 | 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.