Question 2(b) 2015 · October-November · Paper 22 · 3 marks
Reveal official mark-scheme answer

Official answer for Question 2
Part (b)
Part (b)
- other alternative correct algorithm
- a ‘mirror copy’ of the question paper algorithm – score 0
Question 22
Show text version of question
Question 2
Part (b)
Question 2
A program is to simulate the operation of a particular type of logic gate.
- The gate has two inputs (0 or 1) which are entered by the user.
- The program will display the output (0 or 1) from the gate.
The program uses the following identifiers in the pseudocode below:
Identifier Data type Description P INTEGER Input signal Q INTEGER Input signal X INTEGER Output signal
01 INPUT P 02 INPUT Q 03 IF (P = 1 AND Q = 0) OR (P = 0 AND Q = 1) OR (P = 0 AND Q = 0) 04 THEN 05 X 0 ← 06 ELSE 07 X 1 ← 08 ENDIF 09 OUTPUT X
Part (b)
The selection statement (lines 03 – 08) could have been written with more simplified logic.
Rewrite this section of the algorithm in pseudocode.
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...................................................................................................................................................
...............................................................................................................................................[3]
Question 4
Why this question appears here
71% assigned-topic match · Algorithm design and problem-solving › Algorithms
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9608_w15_qp_22.pdf
