Discover answers to your questions with Westonci.ca, the leading Q&A platform that connects you with knowledgeable experts. Ask your questions and receive detailed answers from professionals with extensive experience in various fields. Get precise and detailed answers to your questions from a knowledgeable community of experts on our Q&A platform.

Write a program that will calculate the fuel mileage for a car over a month (4 weeks). The user needs to enter all information required for this calculation is a neat and well developed input menu. Use the following test data to verify your program. Create a neat and block output screen. Make sure your numbers are aligned and format your decimal points to two decimal places. Use Visual Basic.
Test Data:
First Day Of Week Gallons Miles GPA
01/04/2009 5.0 173.0 34.60
01/11/2009 6.0 201.0 33.50
01/18/2009 4.5 121.0 26.89
01/25/2009 4.5 142.0 31.56

Sagot :

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