Skip to content

Course home

Algorithms

Algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
Question 56

An algorithm is designed to calculate the booking fee for a hot-desk at a co-working space as shown below:

10 SEND "Welcome to Co-Work Space" TO DISPLAY
11 SEND "How many days do you wish to book?" TO DISPLAY
12 RECEIVE days FROM (INTEGER) KEYBOARD
13 SEND "Cost based on " & days & " days" TO DISPLAY
14
15 IF (days > 12) THEN
16     SET cost TO 180 + (10 * (days - 12))
17 ELSE
18     IF (days > 8) THEN
19         SET cost TO 180
20     ELSE
21         IF (days > 3) THEN
22             SET cost TO 120
23         ELSE
24             SET cost TO 50
25         END IF
26     END IF
27 END IF
28
29 SEND "Total booking cost: " & cost TO DISPLAY

The algorithm needs to be tested more thoroughly.

Complete the table below to give suitable input test data to meet each requirement.

RequirementInput Test Data
Output cost = 120
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