1. Data types
Pseudocode uses these data types: `INTEGER`, `REAL`, `CHAR`, `STRING`, `BOOLEAN`, `DATE`, `ARRAY` and `FILE`. Choose the type from the value and the comment about it.
A whole number such as 1345 is INTEGER. A number with a decimal part such as 15.75 is REAL. A single letter such as 'S' is `CHAR`. Text such as "Wong", or a code that may contain letters and numbers such as "1B", is STRING. TRUE or FALSE is BOOLEAN. A calendar value such as 19/02/1983 is `DATE`.
A STRING value is written in double quotes and a CHAR value in single quotes. Name each variable for what it holds, for example `MemberName`.
Examiner insight
Worked example 14 marks
A program is being developed to help manage the membership of a football club.
Complete the following identifier table.
| Example value | Explanation | Variable name | Data type |
|---|---|---|---|
| `"Wong"` | The preferred name of the member joining the football club | ||
| `FALSE` | A value to indicate whether an existing member of the club lives at the same address | ||
| `19/02/1983` | When the member joined the football club | ||
| `1345` | The number of points a member has earned. Members of the club earn points for different activities. |
- 1
`"Wong"`: variable `MemberName`, type `STRING` [1]
- 2
`FALSE`: variable `FamilyMember`, type `BOOLEAN` [1]
- 3
`19/02/1983`: variable `StartDate`, type `DATE` [1]
- 4
`1345`: variable `Points`, type `INTEGER` [1]