Answer :
To calculate the mileage we need the formula for mileage
mileage = miles / gallon
Program needed in java :
import java.util.Scanner;
class mileagehistory
{
public static void main(String args[])
{
Scanner scan = new Scanner(System.in);
System.out.print("Enter miles travelled for the First Day Of Week: ");
double miles = scan.nextDouble();
System.out.print("Enter gallons Miles GPA for the first week: ");
double gallons= scan.nextDouble();
System.out.print("miles per gallons = "+distance(miles,gallons));
}
static double distance(double m,double g)
{
return m/g;
}
}
// for the above code repeat for 4 months with 4 weeks each
Hence above code returns the 4-month calculation
To know more on programming follow this link:
https://brainly.com/question/23275071
#SPJ4