//Carl Argila CSC5 Chapter 2, P. 83, #11
//
/**************************************************************
*
* COMPUTE DISTANCE PER TANK OF GAS
* ____________________________________________________________
* This program computes the distance a car can travel on one
* tank of gas based on gas tank capacity and average
* miles-per-gallon (MPG) rating for city and highway driving.
*
* Computation is based on the formula:
* Distance = Number of Gallons x Average Miles per Gallon
* ____________________________________________________________
* INPUT
* tankCapacity : Gas tank capacity in gallons
* mpgCity : Average MPG for city driving
* mpgHighway : Average MPG for highway driving
*
* OUTPUT
* distance : Distance car can travel
*
**************************************************************/
#include <iostream>
#include <iomanip>
using namespace std;
int main ()
{
float tankCapacity; //INPUT - Gas tank capacity in gallons
float mpgCity; //INPUT - Average MPG for city driving
float mpgHighway; //INPUT - Average MPG for highway driving
float distance; //OUTPUT - Distance car can travel
//
// Initialize Program Variables
tankCapacity = 200.0;
mpgCity = 99.5;
mpgHighway = 99.8;
//
// Compute Distance Traveled City
distance = tankCapacity * mpgCity;
//
// Output Result
cout << "The car can travel " << distance << " miles in town." << endl;
//
// Compute Distance Traveled Highway
distance = tankCapacity * mpgHighway;
//
// Output Result
cout << "The car can travel " << distance << " miles highway." << endl;
return 0;
}