A cars miles-per-gallon (MPG) can be calculated with the following formula: MPG = Miles driven / Gallons

Question:

A car’s miles-per-gallon (MPG) can be calculated with the following formula: 

MPG = Miles driven / Gallons of gas used 

Write a program that asks the user for the number of miles driven and the gallons of gas used. It should calculate the car’s miles-per-gallon and display the result on the screen.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Question Posted: