Skip to content

Course home

Algorithms

Algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
Question 20

An algorithm is designed to calculate the shipping charge for an automated drone delivery service based on the weight of a parcel in kilograms, as shown below:

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

The algorithm needs to be thoroughly tested.

Complete the table to give suitable input test data to meet the requirements.

RequirementInput Test Data
Output charge = 25
An output that is not correct (logical error)
[2]
Markscheme

Algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Algorithms

159 exam-style questions on Edexcel GCSE Computer Science Algorithms, covering Constructs for solving problems, Variables, constants and data structures, Arithmetic, relational and logical operators, Tracing algorithm output with trace tables, Types of error and correcting logic errors, Standard algorithms (sorts and searches), and Evaluating algorithm fitness and efficiency. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank