Write a program that computes the number of miles per gallon and kilometers per liter of gas used during an automobile trip. Your program should read the following data: • Your name and vehicle name...


Write a program that computes the number of miles per gallon and kilometers per liter of gas used during an automobile trip. Your program should read the following data:


• Your name and vehicle name as strings


• The number of gallons of gasoline used as a real number


• The initial and final odometer readings (in miles) as integers


Display a report of the data read and the results of the computation. Note that one mile is 1.609344 kilometers and one gallon is 3.785412 liters. Use a format as close to the following as possible:


Please type your name: Jamie


What vehicle do you drive? Jeep


How many gallons of gas did you use? 5.2


What was the initial odometer reading? 55652


What was the final odometer reading? 55793


Jamie, here are the statistics of your recent trip in your Jeep:


Initial odometer reading: 55652


Final odometer reading: 55793


Miles traveled: 141


Kilometers traveled: 227


Miles per gallon: 27.115384615384613


Kilometers per liter: 11.532125473751908


Bonus: Display the miles per gallon and kilometers per liter rounded to one decimal place.



May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here