Thompson Rivers University
MetricUnit – Subclass of MyBMI
Assignment 1 BMI - SM 2025This class also extends MyBMI, just like ImperialUnit. It will inherit name and weight, and it must implement the abstract methods calculateBMI() and getAnalysis().
public class MetricUnit extends MyBMI { }Add private attribute for height
This class stores the height using a single int that holds the value in centimeters.
private int centimeters;Members only
Keep reading this lesson
You've reached the end of the free preview. Unlock the rest of this lesson plus 54 more lessons in Thompson Rivers University.
- Unlimited coding questions
- Unlimited access to all classroom material
- Weekly live call for questions and guidance
- 3,000 AI tutor tokens / month
- Personal SQL database (3 MB)
- Progress tracking
Cancel any time.