Can someone help me with implementing this class?
November 8, 2009 in Programming & Design
Did you know that you can save fuel and run your car on water
hollyk321 questioned:
I have to enter something in java that does the following- implement rank Car- the car has a fastidious fuel efficiency and a fastidious amount of fuel in the tank. The efficiency is specified in the constructor, and the early fuel level is 0- give a mode handbook that simulates driving the car for a fastidious interval, which reduces amount of fuel in tank. Give another mode getGasInTank, which return amount of fuel in tank, and also addGas, which must add gas to the tank-What must my code look like? Thankfulness!!!! Any help at all would be valued.
Did you know that you can save fuel and run your car on water



must look something like this
public rank Car
{
int fuel;
dual mpg;
public Car() //constructor
{
fuel = 0;
mpg = no matter what it must be;
}
public void handbook(int miles)
{
fuel = fuel – (miles / mpg)
}
public int getGasInTank()
{
return fuel;
}
public void addGas(int gas)
{
fuel += gas
}
}