You are on page 1of 4

Unit 2 Programming

6 Making programs easy to read (Student book, pages 51–53)

1 Readability means … (1)

a) the program code contains no syntax errors


b) the program code contains selection and iteration
c) the program code contains no logic errors
d) the program code is easy to read and understand

2 A student is writing the code for a program to calculate the age of a user after they have
entered their date of birth. Which of the options contains the most suitable variable names?
(1)

a) X and Y
b) dateofbirth and age
c) user and date
d) enterdate and age

3 Which of the options below shows the symbol used to denote a comment in the Pearson
Edexcel pseudocode? (1)

a) #
b) /
c) \
d) *

4 To make it easier to see where a block of code starts and finishes, programmers use … (1)

a) comments
b) white space
c) indentation
d) : symbols

© Pearson Education Ltd, 2020. Copying permitted for purchasing institution only. This material is not copyright free.
5 Explain four techniques a programmer should use to make programs easy to read and
understand. (8)

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

……………………………………………………………………………………………………………

© Pearson Education Ltd, 2020. Copying permitted for purchasing institution only. This material is not copyright free.
6 Program the following algorithm and improve its readability. (4)

SEND ‘Please enter your first name’ TO DISPLAY


RECEIVE name1 FROM (STRING) KEYBOARD
SEND ‘Please enter your second name’ TO DISPLAY
RECEIVE name2 FROM (STRING) KEYBOARD
IF name1 = ‘Anna’ AND name2 = ‘Smith’ THEN
SEND ‘Welcome back’ TO DISPLAY
ELSE
SEND ‘Sorry. You cannot log into this program’ TO DISPLAY
END IF

© Pearson Education Ltd, 2020. Copying permitted for purchasing institution only. This material is not copyright free.
7. Complete the above Pseudo code and convert it into python language and paste a
screen shot of your program here. Ensure you have applied methods of suitable
readable code.

© Pearson Education Ltd, 2020. Copying permitted for purchasing institution only. This material is not copyright free.

You might also like