I need help coding this ASAP
Project 16A- Gas Mileage
package: mileage
Class: 2 files -...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 12.12.2020 15:50 karatekats1
I need help coding this ASAP
Project 16A- Gas Mileage
package: mileage
Class: 2 files - Main. java, and Automobile. java
Create a class called Automobile in which you pass a gas mileage (miles per gallon)
parameter to the constructor which in turn passes it to the state variable, mpg. The
constructor should also set the state variable gallons (gas in the tank) to 0. A method called
fillUp adds gas to the tank. Another method, takeTrip, removes gas from the tank as the
result of driving a specified number of miles. Finally, the method reportFuel returns how
much gas is left in the car.
**Also throw in a way to calculate the cost of a trip to your interface.
Test your Automobile class by creating a Tester class as follows:
public class Tester
{
public static void main( String args[] )
{
//Create a new object called myBmw. Pass the constructor an
//argument of 24 miles per gallon
Automobile myBmw = new Automobile(24);
//Use the myBmw object to call the fillup method. Pass it an argument
//of 20 gallons.
myBmw. fillUp(20);
//Use the myBmw object to call the takeTrip method. Pass it an
//argument of 100 miles. Driving 100 miles of course uses fuel and we
//would now find less fuel in the tank.
myBmw. takeTrip(100);
//Use the myBmw object to call the reportFuel method. It returns a
//double value of the amount of gas left in the tank and this is assigned
// to the variable fuel_left
double fuel_left = myBmw. reportFuel( );
//Print the fuel_left variable
System. out. println(fuel_left); //prints gallons left, 15.833333333333332
}
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 08:50
Can online classes such as gradpoint track your ip location like if im taking a final and i give somebody else my account and they take the final for me will it show where they are taking the final from? and can this be countered with a vpn
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 22:50
Which is the best minecraft server? a. mineplex b. worldonecraft c. 9b9t d. 2b2t
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 23:30
What are listed in the vertical columns across the top of the event editor? a. file names b. conditions c. check marks d. action types
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 23.06.2019 10:00
Install and use wireshark program ( send back screen shots and other vital information) case project 3-2: decode a tcp segment in a wireshark capture in this chapter, you walked through tcp segment to interpret the data included in its header. in this project, you use wireshark to capture your own http messafes, examine the tcp headers, and practice interpreting the data you'll find there. 1. open wireshark and snap the window to one side of your screen. open a browser and snap that window to the other side of your screen so you can see both windows.
Answers: 2
You know the right answer?
Questions
![question](/tpl/images/cats/himiya.png)
Chemistry, 15.12.2020 20:40
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/biologiya.png)
Biology, 15.12.2020 20:40
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 15.12.2020 20:40
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/biologiya.png)
Biology, 15.12.2020 20:40
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 15.12.2020 20:40
![question](/tpl/images/cats/istoriya.png)
History, 15.12.2020 20:40
![question](/tpl/images/cats/geografiya.png)
Geography, 15.12.2020 20:40
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/istoriya.png)
History, 15.12.2020 20:40
![question](/tpl/images/cats/mkx.png)
Arts, 15.12.2020 20:40
![question](/tpl/images/cats/mat.png)
Mathematics, 15.12.2020 20:40
![question](/tpl/images/cats/himiya.png)
Chemistry, 15.12.2020 20:40