Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Consider the following classes public abstract class Vehicle { public boolean st

ID: 3552426 • Letter: C

Question

Consider the following classes

public abstract class Vehicle {

public boolean startEngine() {/* code */ }

public abstract int getMaxSpeed();

public abstract double getVehicleValue();

}

public interface Rentable {

public double getWeeklyRate();

}

public interface UsesPremiumGas {

public void fillTankWithPremiumGas(double gallons);

}

public class Car extends Vehicle implements Rentable {/*code*/}

public class FancyCar extends Car implements UsesPremiumGas

{ /* code */ }

public class Bus extends Vehicle { /* code */ }

Answer the following questions (must means so that the code compiles).

a) Which methods must be implemented in the Car class?

b) Which methods must be implemented in the FancyCar class?

c) Which methods must be implemented in the Bus class?

Explanation / Answer

<<a>>

public int getMaxSpeed()

public double getVehicleValue()

public double getWeeklyRate()

--------------------------------------------------------------------------------------------------

<<b>>

public void fillTankWithPremiumGas(double gallons)

--------------------------------------------------------------------------------------------------

<<c>>

public int getMaxSpeed()

public double getVehicleValue()

--------------------------------------------------------------------------------------------------

<<d>>

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote