Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A car with a 2 0 - gallon gas tank averages 2 1 . 5 miles per gallon when driven in town and 2 6
A car with a gallon gas tank averages miles per gallon when driven in town and 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:
DistanceNumber of Gallons x Average Miles Per Gallon.
See below a sample screen output, after a successful "compile and run" using the wxDevC IDE.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started