ITPEC FE Morning April 2019 Question 48
Source exam: ITPEC FE Morning April 2019Topic: Software Development
ITPEC FE Morning April 2019 — Question 48 of 80
Subclass vs. Component (OOP) — identify the correct "is-a" relationship.
A subclass must satisfy the "is-a" test with its superclass.
- •Truck is an Automobile → ✅ valid subclass
- •Engine → part of an automobile (
has-a= composition) - •Manufacturing number → attribute/property of an automobile
- •Tire → part of an automobile (
has-a= composition)
Why not others:
- (a) Engine — component, not a type of automobile
- (b) Manufacturing number — data attribute, not a class
- (c) Tire — component, not a type of automobile
Key rule: Inheritance = "is-a"; Composition = "has-a". If you can say "X is a Y," then X is a subclass of Y.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.