Question 3(d)(ii) 2025 · May-June · Paper 42 · 3 marks
Reveal official mark-scheme answer
Official answer for Question 3
Part (d)
(ii)
Question 1
mark each
Question 3
- Calling SetTerritorySize(-20) for instance of Nighteyes
- Calling ChangeNumberWords(2) for instance of Chewie
- Calling Description() for all 3 animals (after any updates) and outputting return values
Show text version of question
Question 3
Part (d)
(ii)
Question 3
A program stores data about animals using Object‑Oriented Programming (OOP).
The class Animal stores the data about animals.
Animal Name : String stores the name of the animal
Sound : String stores the sound the animal makes
Size : Integer stores the size of the animal as an integer between 1 (smallest) and 10 (largest)
Intelligence : Integer stores the intelligence of the animal as an integer between 1 (least) and 10 (most) Constructor() initialises all attributes to its parameter values
Description() returns a string message that contains the data from the attributes
(ii)
The main program also needs to:
- decrease the territory for the wolf Nighteyes by 20 square miles
- increase the number of words the parrot Chewie can say by 2 words
- output the description for all three animals.
Write program code to extend the main program.
Save your program.
Copy and paste the program code into part 3(d)(ii) in the evidence document.
Why this question appears here
49% assigned-topic match · Further programming › Programming paradigms
Topic-match percentages estimate how closely each question fits the selected syllabus topic. They are a guide for choosing stricter or broader practice.
Permanent source page: Educate A Change · From 9618_s25_qp_42.pdf
