Question: This Java program must use classes and object-oriented design (OOD) (Gas Mileage) Drivers are concerned with the mileage their automobiles get. One driver has kept
This Java program must use classes and object-oriented design (OOD)
(Gas Mileage) Drivers are concerned with the mileage their automobiles get. One driver has kept track of several 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 calculate 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 results. Use class Scanner and sentinel-controlled repetition to obtain the data from the user.
IMPORTANT NOTE!!: This program must use classes and object-oriented design (OOD). Also, please add detailed, but brief comments to most, if not all of the code to explain what is being used in the code and what is does so I have a better understanding of the code. Thank you! :)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
