Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please use java do this Program 3 (50 points) For this part of the assignment, you will create two files: one that contains the definition
Please use java do this
Program 3 (50 points) For this part of the assignment, you will create two files: one that contains the definition of a MotorBoat class and one that contains the main method and tests the MotorBoat class. Here are the specifications Create a class MotorBoat with the following attributes: . The capacity of the fuel tank (measured in gallons) . The amount of fuel in the tank (measured in gallons) . The maximum speed of the boat (measured in miles per hour) . The current speed of the boat (measured in miles per hour) .The efficiency of the boat motor (measures how many gallons are needed to travel one mile) .The distance traveled (measured in miles) Your class should implement the following methods .A constructor that takes three arguments that represent a boat's tank capacity, maximum speed, and motor efficiency. All other attributes should be set to 0 Inspector methods that return the values of distance traveled, current speed, amount of fuel in the tank, maximum speed, and tank capacity .A method that allows you to refuel the boat with some amount of fuel .A method to change the speed of the boat .A method that allows you to operate the boat for an amount of time at the current speed. Keep in mind that when you operate the boat, you will travel a certain distance (distance traveled ime travel speed, and in doing so, you will consume fuel. Both of those attributes will need to be updated by this methodStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started