<public class Lab5a
{
Scanner input = new Scanner( System.in);
int gallons_of_gas = 0;
int milesDriven = 0;
int tankCounter = 1;
totalMpg = 0;
while ( gallons_of_gas != -999 )
System.out.print( "Enter gallons used in filling up the tank or enter -999 to quit: " );
gallos_of_gas = input.nextInt();
System.out.print( "Enter miles driven since tank was full: " );
milesDriven = Input.nextInt();
System.out.printf( "MPG this tankful: d\n% ", milesDriven / gallons_of_gas );
if (gallons_of_gas = -999 )
System.out.printf( "Thank you for using the mileage counter 3000, please come again" );
}