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();
2. 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?
3. 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[3];
team[0]= new Athlete(220,72);
team[1]= new Athlete(100,58);
team[2]= new Athlete(165,68);
System.out.println(getMinHeight(team));
4. Create a new class Animal that implements both the Matter Interface and the Height
Interface.
 (In java pls ) Create a new Interface called Height that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!