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.

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.

The Correct Answer and Explanation is:

The calculations show that a car with a 20-gallon gas tank can travel 430 miles when driven in town and 536 miles when driven on the highway.

Explanation of the Calculation

To determine how far a car can travel on one tank of gas, we utilize two key pieces of information: the car’s gas tank capacity and its fuel efficiency under different driving conditions. In this case, the car has a 20-gallon gas tank. The miles per gallon (mpg) efficiency is given as 21.5 mpg for town driving and 26.8 mpg for highway driving.

The first step in the calculation involves multiplying the gas tank capacity by the fuel efficiency for each driving condition. This allows us to compute the total distance the car can cover in each scenario.

  1. Calculating Distance in Town:
  • The formula used is:
    [
    \text{Distance}_{\text{town}} = \text{Gas Tank Capacity} \times \text{Miles per Gallon (town)}
    ]
  • Substituting the values:
    [
    \text{Distance}_{\text{town}} = 20 \, \text{gallons} \times 21.5 \, \text{mpg} = 430 \, \text{miles}
    ]
  1. Calculating Distance on the Highway:
  • Similarly, for highway driving:
    [
    \text{Distance}_{\text{highway}} = \text{Gas Tank Capacity} \times \text{Miles per Gallon (highway)}
    ]
  • Substituting the values:
    [
    \text{Distance}_{\text{highway}} = 20 \, \text{gallons} \times 26.8 \, \text{mpg} = 536 \, \text{miles}
    ]

This straightforward multiplication gives us the distance the car can travel on one tank of gas in both urban and highway settings. Such calculations are useful for planning trips and estimating fuel needs, helping drivers to understand how their vehicle performs under different driving conditions.

Scroll to Top