(Assignment) I Am Lost
As written, the program design requires sentinel controlled repitition. This should be the second program that you write.
For the first program, assume that there are exactly 6 miles driven/gallons sets of input. This will require counter-controlled repetition.
OK, this is all I got so far. I know it looks stupid, but any help in the 1st part would be deeply appreciated.
import.java.util.Scanner;
public class MPG
{
Scanner input = new Scanner( System.in );
int gallons;
int tank;
int miles;
double avg;
double avg_all
total = 0;
counter = 1;
while ( counter <= 6 )
{
System.out.print( "Enter gallons: " );
gallons = input.nextInt();
System.out.print( "Enter miles: " );
miles = input.nextInt();
}
average = total \ 6;
System.out.printf( "\nTotal of all 6 tanks is %d\n", total );
System.out.printf( "average mpg

