b. Test Your Knowledge
Activity Set – Data Types ( KK 3.1.4 )
A. Multiple-choice review
(1 mark each – Section A style)
1. Which of the following is the most efficient data type to store the number of seats in a theatre?
A. String
B. Boolean
C. Integer
D. Floating point
Answer
C. Integer
2. A Boolean variable is best used when:
A. A number needs to be stored with decimal places
B. Only two possible states or outcomes exist
C. A long paragraph of text must be stored
D. Multiple values must be stored together in a structure
Answer
B. Only two possible states or outcomes exist
3. In most programming languages, which operator tests for inequality?
A. =
B. !=
C. ==
D. :=
Answer
B. !=
4. A variable price will always contain whole numbers of cents. Which data type should be used?
A. Boolean
B. Float
C. Integer
D. String
Answer
C. Integer
B. Short-answer practice
(2–4 marks each – Section B style)
-
Explain the difference between a numeric and text data type.
-
Outline two reasons why selecting an efficient data type is important in software development.
-
Describe one situation where using a Boolean variable would simplify decision-making.
-
Identify the output of the following pseudocode fragment and state its data type:
-
Explain why date/time values are considered numeric data in most languages.
C. Coding / pseudocode exercise
(3–6 marks – Outcome 1 style)
Write pseudocode for a short program that:
Requirements:
- Stores a person's name, age and membership status (active/inactive)
- Prints a welcome message only if the member is active and over 18
- Include variable declarations and appropriate data types
Activity Set – Data Structures ( KK 3.1.5 )
A. Identify the structure
(1 mark each – recall check)
Indicate whether each description refers to a one-dimensional array, two-dimensional array or record:
1. Stores student names, IDs and GPAs.
Answer
Record (contains fields of different data types)
2. Represents seats in a cinema arranged in rows and columns.
Answer
Two-dimensional array (organized in rows and columns)
3. Contains the daily sales totals for a month.
Answer
One-dimensional array (linear list of values)
B. Construct and label
(diagram / short answer – 3–4 marks)
Draw and label:
-
A one-dimensional array with five integer elements.
-
A two-dimensional array representing weekly temperatures (days × times).
-
A record structure for a library book containing title (text), ISBN (number) and onLoan (Boolean).
C. Algorithm challenge
(4–6 marks – applied reasoning)
Using pseudocode, design an algorithm that:
Requirements:
- Declares a one-dimensional array named scores containing 10 integers
- Calculates the average score
- Displays "Pass" if the average is ≥ 50, otherwise "Fail"
D. Compare and justify
(4 marks – extended reasoning)
Explain two differences between arrays and records. For each difference, describe a practical scenario in which one structure would be preferred over the other.
E. Mixed-structure design task
(8 marks – mini case study / Section C style)
You are designing a sports-team management system.
Requirements:
- Each player has a name, position, age and weekly scores
- The coach wants to display each player's average weekly score
Tasks:
-
Identify which data types are needed for each field.
-
Describe an appropriate data structure (or combination) to store all player information.
-
Outline the steps required to calculate and output each player's average.
Extension Task
Research and describe two other data structures used in object-oriented programming (e.g. lists, dictionaries) and explain how they relate to arrays or records.
Write pseudocode showing how nested arrays could represent a simple timetable.