Skip to content

Course home

Representing algorithms

Representing algorithms

EasyMediumHard
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
Question 55

A smart sorting conveyor belt in a distribution center uses the algorithm shown below to route packages to different sorting zones.

1      category ← USERINPUT
2      IF category = 'express' THEN
3          passes ← 4
4      ELSE IF category = 'standard' THEN
5          passes ← 2
6      ELSE
7          passes ← 0
8      ENDIF
9      FOR i ← 1 TO passes
10         IF i < 3 THEN
11             ROUTE_TO('conveyor_A')
12         ELSE
13             ROUTE_TO('conveyor_B')
14             IF passes > 2 THEN
15                 ROUTE_TO('conveyor_C')
16             ENDIF
17         ENDIF
18     ENDFOR

How many times would the subroutine ROUTE_TO be called if the user input is 'express'?

A

2 subroutine calls

B

4 subroutine calls

C

5 subroutine calls

D

6 subroutine calls

Markscheme

Representing algorithms Questions

  1. GCSE
  2. /Computer Science
  3. /Representing algorithms

208 exam-style questions on AQA GCSE Computer Science Representing algorithms. Each one has a worked solution and a mark scheme showing where the marks go.

Question bank