Skip to content
MathsGenie logo
Open app

Course home

  1. GCSE
  2. Computer Science Edexcel
  3. Question bank

Computational thinking

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637
Question 32

An algorithm is used to calculate the delivery charge of a heavy-duty drone courier based on the weight of a package in kilograms.

10 SEND "Drone Express Shipping Calculator" TO DISPLAY
11 SEND "Enter package weight in kg:" TO DISPLAY
12 RECEIVE weight FROM (INTEGER) KEYBOARD
13 SEND "Processing shipping for " & weight & " kg" TO DISPLAY
14
15 IF (weight > 12) THEN
16     SET charge TO 35 + (3 * (weight - 12))
17 ELSE
18     IF (weight > 7) THEN
19         SET charge TO 35
20     ELSE
21         IF (weight > 3) THEN
22             SET charge TO 20
23         ELSE
24             SET charge TO 8
25         END IF
26     END IF
27 END IF
28
29 SEND "Total: £" & charge TO DISPLAY

Complete the table below to show the final output displayed by line 29 of the algorithm for each given input.

InputOutput
16
3
8
[3]

Computational thinking Questions

  1. GCSE
  2. /Computer Science
  3. /Computational thinking