Ask Question
2 February, 06:42

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

+3
Answers (1)
  1. 2 February, 08:43
    0
    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;

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “java Consider a class MotorBoat that represents motorboats. A motorboat has attributes for: The capacity of the fuel tank The amount of ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers