Specifications

Sun Services
Java™ Programming Language
Module 7, slide 30 of 44
Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. Sun Services, Revision F
Abstract Classes
16 // Calculate the fuel needed for this trip
17 fuel = v.calcTripDistance() / v.calcFuelEfficency();
18
19 output.println("Vehicle " + v.getName() + " needs "
20 + fuel + " liters of fuel.");
21 total_fuel += fuel;
22 }
23 output.println("Total fuel needs is " + total_fuel + " liters.");
24 }
25 }