Skip to content

Course home

Sign up

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
Question 70

An algorithm is designed to calculate the rental fee for a bicycle hire scheme as shown below:

10 SEND "Welcome to Cycle Rentals" TO DISPLAY
11 SEND "How many hours do you wish to rent?" TO DISPLAY
12 RECEIVE hours FROM (INTEGER) KEYBOARD
13 SEND "Cost based on " & hours & " hours" TO DISPLAY
14
15 IF (hours > 10) THEN
16     SET fee TO 30 + (5 * (hours - 10))
17 ELSE
18     IF (hours > 6) THEN
19         SET fee TO 30
20     ELSE
21         IF (hours > 2) THEN
22             SET fee TO 20
23         ELSE
24             SET fee TO 10
25         END IF
26     END IF
27 END IF
28
29 SEND "Total fee: " & fee TO DISPLAY

The algorithm needs to be tested more thoroughly.

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

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

Computational thinking Questions

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

Question bank