Please understand that I don't expect you to do my work; I was just hoping that after 2 days of work someone could point me in the right direction.
This is my code.
any help would be much appreciated.
Here's the assignment:
http://pavao.org/compsci/apcs/WebLessons2/LessonA4/Lab-A4-1.html
Here's the code:
public class Car{
int start;
int end;
double gasUsed;
public void car(int odometerReading){
}
public void fillUp(int odometerReading, double gallons){
}
public double calculateMPG(){
calculateMPG = odometerReading - start / gallons;
}
public double resetMPG(){
start = odometerReading;
}
public void calculate(){
Car auto = new Car(15);
System.out.println("New car odometer reading: ");
auto.fillUp(150,
;
System.out.println("Miles per gallon" + auto.calculateMPG());
System.out.println("Miles per gallon" + auto.calculateMPG());
auto.resetMPG();
auto.fillUp(350, 10);
auto.fillUp(450, 20);
System.out.println("Miles per gallon" + auto.calculateMPG());
auto.resetMPG();
auto.fillUp(603, 25.5);
System.out.println("Miles per gallon" + auto.calculateMPG());
}
}
[/code]
This is my code.
any help would be much appreciated.
Here's the assignment:
http://pavao.org/compsci/apcs/WebLessons2/LessonA4/Lab-A4-1.html
Here's the code:
public class Car{
int start;
int end;
double gasUsed;
public void car(int odometerReading){
}
public void fillUp(int odometerReading, double gallons){
}
public double calculateMPG(){
calculateMPG = odometerReading - start / gallons;
}
public double resetMPG(){
start = odometerReading;
}
public void calculate(){
Car auto = new Car(15);
System.out.println("New car odometer reading: ");
auto.fillUp(150,
System.out.println("Miles per gallon" + auto.calculateMPG());
System.out.println("Miles per gallon" + auto.calculateMPG());
auto.resetMPG();
auto.fillUp(350, 10);
auto.fillUp(450, 20);
System.out.println("Miles per gallon" + auto.calculateMPG());
auto.resetMPG();
auto.fillUp(603, 25.5);
System.out.println("Miles per gallon" + auto.calculateMPG());
}
}
[/code]
