Your tasks are The calculation is just: So, to calculate the mileage between the
ID: 3532278 • Letter: Y
Question
Your tasks are
The calculation is just:
So, to calculate the mileage between the first two fuelings, we have (91538 - 91183) / 11.007 = ~32.234. Note that we cannot calculate mileage if we do not have a previous odometer reading available, so the gallons in the first line is not used. Your mileage values should look something like:
Write your code in a class named MileageCalculator. Do step 1 in a static helper method that returns the constructed ArrayList, and do the rest in the mainmethod using that list.