Class diagram inheritance for animal classification
2025-hsc-se-q22 · Diagram Response · 3 marks
Source: NESA 2025 HSC Software Engineering HSC Q22
Question
An animal classification tool is to be developed. The classes to be used are shown below.
Mammal
| Attribute |
|---|
| Colour |
| Size |
| Birth type |
| Number of teeth |
Reptile
| Attribute |
|---|
| Colour |
| Size |
| Scale type |
| Tongue type |
Whale
| Attribute |
|---|
| Colour |
| Size |
| Birth type |
| Number of teeth |
| Blowhole type |
| Migration location |
Dog
| Attribute |
|---|
| Colour |
| Size |
| Birth type |
| Number of teeth |
| Breed |
| Fur |
Construct a class diagram that shows inheritance and removes redundant attributes for each class. Additional classes may be included if required.
You do NOT need to show the nature of the relationships between the classes.
Response
Diagram workspace
Reveal answer
A suitable class diagram includes:
Animal: Colour, SizeMammalinherits fromAnimal: Birth type, Number of teethReptileinherits fromAnimal: Scale type, Tongue typeWhaleinherits fromMammal: Blowhole type, Migration locationDoginherits fromMammal: Breed, Fur
Marking rubric
| Marks | Description |
|---|---|
| 3 | Constructs a correct inheritance structure and removes redundant attributes. |
| 2 | Shows a mostly correct inheritance structure or removes most redundant attributes. |
| 1 | Shows some understanding of classes, attributes or inheritance. |
Explanation
Colour and size can be generalised to an Animal superclass. Mammal-specific attributes can be placed in Mammal, then Whale and Dog only need their own specialised attributes.
Metadata
- Submitter
- Seed data
- Created
- 2026-05-02
- Status
- published
- Syllabus
- y12-project-modelling-tools y12-project-tools-for-ideas-solutions
- Tags
- class diagrams inheritance OOP redundant attributes