
Patrick B. answered 04/22/20
Math and computer tutor/teacher
using namespace std;
#include <iostream>
int main()
{
int numGallons=-1;
int mpg=-1;
while (numGallons<=0)
{
cout << " How many gallons in the tank ???? :>";
cin >> numGallons;
}
while (mpg<=0)
{
cout << " How many miles per gallon :>";
cin >> mpg;
}
long miles = numGallons*mpg;
cout << " miles = " << miles << endl;
}