Question
(Gas Mileage) Drivers are concerned with the mileage their automobiles get. One driver has kept track of serveral trips by recording the miles driven and
(Gas Mileage) Drivers are concerned with the mileage their automobiles get. One driver has kept track of serveral trips by recording the miles driven and gallons used for each tankful. Develop a Java application that will input the miles driven and gallons used (both as integers) for each trip. The program should calcuate and display the miles per gallon obtained for each trip and print the combined miles per gallon obtained for all trips up to this point. All averaging calculations should produce floating -point reults. Use class Scanner and sentinel-controlled reptition to obtain the data from the user.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started