Skip to content

Course home

Sign up

Computational thinking

EasyMediumHard
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
Question 52

An algorithm is used to determine the admission prices for a local museum.

The pseudocode for this algorithm is shown below.

  • The values for month are 1 = January, 2 = February ... 12 = December.
  • The values for category represent visitor types: 1 = Child, 2 = Student, 3 = Standard Adult.
1 IF (month = 12) THEN
2     SEND ("Closed for maintenance") TO DISPLAY
3 ELSE
4     IF (month >= 6) AND (month <= 8) THEN
5         IF (category = 1) OR (category = 2) THEN
6             SEND ("£5.00") TO DISPLAY
7         ELSE
8             IF (category = 3) THEN
9                 SEND ("£12.00") TO DISPLAY
10            ELSE
11                SEND ("High season category error") TO DISPLAY
12            END IF
13        END IF
14    ELSE
15        IF (month >= 1) AND (month <= 11) THEN
16            IF (category = 1) OR (category = 2) THEN
17                SEND ("£3.00") TO DISPLAY
18            ELSE
19                IF (category = 3) THEN
20                    SEND ("£8.00") TO DISPLAY
21                ELSE
22                    SEND ("Low season category error") TO DISPLAY
23                END IF
24            END IF
25        ELSE
26            SEND ("Month error") TO DISPLAY
27        END IF
28    END IF
29 END IF

Complete the table to show the output of the pseudocode algorithm based on the given inputs.

InputOutput displayed
monthcategory
122
73
41
[3]
Markscheme

Computational thinking Questions

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

Question bank