/**********************************************************************************
* PROGRAMMED BY : DAISY CONTRERAS
* CLASS : CSC 5
* SECTION : MW 2:20-5:30PM
* ASSIGNMENT : CHAPTER 2 QUESTION #10
**********************************************************************************
*
* COMPUTE THE NUMBER OF MILES A CAR CAN BE DRIVEN BY THE GALLON
* ________________________________________________________________________________
* This program computes the miles a car can be driven given the miles driven and
* and the gallons of gas it has.
Computation is based on the formula :
Miles per gallon = miles driven / gallons of gas in capacity
________________________________________________________________________________
INPUT
car_gallon_gas : amount of gallons of gas a car has in capacity
miles_driven : miles were driven
OUTPUT
miles_per_gallon : miles that can be driven based on the number of gallons
*
* ********************************************************************************/
#include <iostream>
using namespace std;
int main() {
//This program calculates the number of miles per gallon a car gets
float car_gallon_gas; //INPUT gallons of gas a car has
float miles_driven; //INPUT miles that were driven
float miles_per_gallon; //OUTPUT miles that can be driven by full tank capacity
// Compute the gallons of gas a car has in full capacity
car_gallon_gas = 12;
// Define the miles that can be driven at full tank capacity
miles_driven = 350;
// Compute the MPG
miles_per_gallon = miles_driven / car_gallon_gas;
// Display the miles per gallon a car can be driven
cout << miles_per_gallon << " Miles Per Gallon (MPG)" << endl;
return 0;
}