Question: ( In java pls ) Create a new Interface called Height that contains two methods. HINT: you can create a new interface similar to how
In java pls Create a new Interface called Height that contains two methods. HINT: you can create a
new interface similar to how you create a new class.
a double getHeightInches;
b double getHeightCentimeters;
Have the Athlete class implement the Height interface Athlete should still implement the
Matter Interface too HINT: you can use a comma to separate the interfaces
a Add the instance variable inches to the Athlete class and modify the constructor
so it takes in two arguments: weight and inches
b What happened to the MassAverager code? Why? How can you fix it
Create a static method called getMinHeight in Athlete that takes in an array of athletes
and returns the minimum height of all the athletes. This is very similar to the getLargest
method you implemented in the Planet class.
a Test out your code by creating a main method in the Athlete class and copying
the code below into the main method
Athlete team new Athlete;
team new Athlete;
team new Athlete;
team new Athlete;
System.out.printlngetMinHeightteam;
Create a new class Animal that implements both the Matter Interface and the Height
Interface.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
