Skip to content

Course home

Sign up

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
Question 66

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

Computational thinking Questions

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

Question bank