Made with Xodo PDF Reader and Editor
QUESTION 1. 8
4 Four statement types and four examples are shown below.
Draw a line to connect each statement type to the correct example.
Statement type Example
Assignment FOR X 1 TO 10
Iteration READ X
Input PRINT X
Output X Y + Z
[3]
5 A programmer writes a program to store a patient’s temperature every hour for a day.
State the data structure that would be most suitable to use and give the reason for your choice.
Data structure ...................................................................................................................................
Reason ..............................................................................................................................................
......................................................................................................................................................[2]
6 Identify two different selection statements that you can use when writing pseudocode.
1 ........................................................................................................................................................
..........................................................................................................................................................
2 ........................................................................................................................................................
......................................................................................................................................................[2]
© UCLES 2016 0478/22/M/J/16
Made with Xodo PDF Reader and Editor
Question 7 begins on page 10.
© UCLES 2016 0478/22/M/J/16 [Turn over
Made with Xodo PDF Reader and Editor
QUESTION 2. 7
Section B
2 Most programming languages include basic data types. Ahmad is describing the basic data types
he has used.
State the data type that Ahmad is describing in each sentence.
Choose the data type from this list of programming terms.
Array Boolean Char Constant Function Integer
Iteration Procedure Real String Variable
A number with a fractional part that can be positive or negative and used in calculations
Data type ..........................................................................................................................................
A whole number that can be positive, negative or zero and used in calculations
Data type ..........................................................................................................................................
A single number, symbol or letter
Data type ..........................................................................................................................................
A sequence of characters
Data type ..........................................................................................................................................
A data type with two values, True or False
Data type ..........................................................................................................................................
[5]
© UCLES 2020 0478/22/M/J/20 [Turn over
Buy O / A Level & IGCSE Original Books, Solved Past Papers & Notes Online at Discounted Prices.
Home Delivery all over Pakistan Call / WhatsApp: (0331-9977798) Visit: [Link]/Shop
Made with Xodo PDF Reader and Editor
Buy IGCSE, O / A Level Books, Past Papers & Revision Notes Online at Discounted Prices across Pakistan
Visit: [Link] / Shop Call / WhatsApp: (0331-9977798)
QUESTION 3. 10
4 Four validation checks and four descriptions are shown.
Draw a line to connect each validation check to the correct description.
Validation Check Description
Range check Checks that some data is entered.
Checks for a maximum number of characters
Presence check
in the data entered.
Checks that the characters entered are all
Length check
numbers.
Checks that the value entered is between an
Type check
upper value and a lower value.
[3]
5 A programmer writes a program to weigh baskets of fruit in grams, keeping a total of the weight
and counting the number of baskets. The total weight is stored in a variable Total and the number
of baskets is stored in a variable BasketCount.
Explain, including examples of programming statements, how totalling and counting could be used
in this program.
Totalling .............................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
Counting ...........................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
..........................................................................................................................................................
[4]
© UCLES 2019 0478/22/O/N/19