d. Applied Task
Read each scenario carefully.
Marks are awarded for correct selection and justification using textbook terminology.
Task 1: Variables and constants (5 marks)
A program manages an online quiz.
The quiz:
- allows a maximum of 3 attempts
- stores the current attempt number
- checks the attempt number in multiple parts of the program
a. Identify the most appropriate feature to store the maximum number of attempts. (1 mark)
b. Identify the most appropriate feature to store the current attempt number. (1 mark)
c. Justify your answers to parts (a) and (b). Your response should refer to scope and data reliability. (3 marks)
Task 2: Function or method? (6 marks)
For each requirement below:
- identify whether a function or method should be used
- justify your choice
a. Calculating the total cost of a purchase and returning the value for further processing. (3 marks)
b. Displaying an error message to the user when invalid data is entered. (3 marks)
Task 3: Classes and objects (6 marks)
A software system stores information about books in a library.
a. Identify which of the following should be implemented as a class and which as an object: (2 marks)
- Book
- book1
b. Explain the difference between a class and an object. (2 marks)
c. Explain one advantage of using classes and objects in this system. (2 marks)
Task 4: Integrated scenario (6 marks)
A student designs a program that:
- stores a fixed tax rate
- calculates the final price of a product
- prints the final price to the screen
a. Identify: (3 marks)
- one constant
- one function
- one method
that should be used in this program.
b. Justify the use of each feature you identified in part (a). (3 marks)
Common mistakes to avoid (examiner patterns)
Don't Make These Mistakes
❌ Identifying a method where a value must be returned
❌ Using a variable instead of a constant for fixed values
❌ Confusing a class with an object
❌ Describing scope without mentioning accessibility
40+ Exam Tip
High-scoring responses explicitly link feature → purpose → benefit
Example:
"A constant is appropriate because the value must not change and this improves reliability."