Write a program that asks the user (or 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.
Given formula :
MPG = Miles driven / Gallons of gas used
Note : might want it to be double so as to avoid data being truncated.
No comments:
Post a Comment