
Andy C. answered 10/24/18
Math/Physics Tutor
using namespace std;
#include <iostream>
#define NUM_GALLONS (30)
int main()
{
float mileage;
int mpg;
std::cout << "PLEASE INPUT THE ROUND TRIP MILEAGE :>";
std::cin >> mileage;
if (mileage <=0)
{
std::cout << " No trip. Program has ended..."<<endl;
}
else
{
std::cout << " PLEASE INPUT THE MPG :> ";
std::cin >> mpg;
if ((mpg >25) && (mileage<100))
{
cout << "It is not economical to use this vehicle " << endl;
}
else
{
float numFillups = (mileage / (NUM_GALLONS*mpg));
std:cout << " # of fill ups = " << numFillups << endl;
}
}
return 0;
}