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:
Related Book For
Starting Out With Java From Control Structures Through Data Structures
ISBN: 9780133957051
6th Edition
Authors: Tony Gaddis
Question Posted: