/******************************************************************
 * Calculate Miles Per Gallon
 *
 * Determines a car's fuel efficiency, expressed as the number of
 * miles it can travel on one gallon of gas.
 ******************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
 
int main()
{
    double gallons;         // Number of gallons the tank holds
    double milesDriven;     // Miles driven on a full tank
    double milesPerGallon;  // Calculated fuel efficiency
 
    // Get the tank capacity and the distance driven on a full tank.
    cout << "Enter the number of gallons the tank holds: ";
    cin >> gallons;
    cout << "Enter the number of miles driven on a full tank: ";
    cin >> milesDriven;
 
    // Calculate the car's fuel efficiency.
    milesPerGallon = milesDriven / gallons;
 
    // Display the result.
    cout << fixed << showpoint << setprecision(2);
    cout << "\nYour car gets " << milesPerGallon
         << " miles per gallon.\n";
 
    return 0;
}
 
