java Consider a class MotorBoat that represents motorboats. A motorboat has attributes for: The capacity of the fuel tank The amount of fuel in the tank The maximum speed of the boat The current speed of the boat The efficiency of the boat's motor The distance traveled The class has methods to: Change the speed of the boat Operate the boat for an amount of time at the current speed

Respuesta :

Explanation:

Below is the java code for the class MotorBoat  : -

public class MotorBoat {

   private int tankCapacity;

   private int fuelAmount;

   private double maxBoatSpeed;

   private double currentBoatSpeed;

   private double efficacy;

   private double distanceTravelled;

   

   public void changeSpeed(double speed){

       currentBoatSpeed = speed;

   }

   public double operateBoat(double time){

       distanceTravelled = currentBoatSpeed * time;

       return distanceTravelled;

   }

}

ACCESS MORE