Visit www.myprogramminglab.com to complete many of these Programming Challenges online and get instant feedback.
Distance per Tank of Gas
A car with a 20-gallon gas tank averages 21.5 miles per gallon when driven in town and 26.8 miles per gallon when driven on the highway. Write a program that calculates and displays the distance the car can travel on one tank of gas when driven in town and when driven on the highway.
Hint: The following formula can be used to calculate the distance:
Distance = Number of Gallons ◊◊Average Miles per Gallon
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.