2.2.1 Programming Concepts
2.2.1 Programming Concepts
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.
Reason ..............................................................................................................................................
......................................................................................................................................................[2]
6 Identify two different selection statements that you can use when writing pseudocode.
1 ........................................................................................................................................................
..........................................................................................................................................................
2 ........................................................................................................................................................
......................................................................................................................................................[2]
Section B
2 Most programming languages include basic data types. Ahmad is describing the basic data types
he has used.
A number with a fractional part that can be positive or negative and used in calculations
A whole number that can be positive, negative or zero and used in calculations
A sequence of characters
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]