#include #include using namespace std; int main() { double miles {0.0}; cout << "How many miles?\n"; cin >> miles; if (!cin) { cerr << "sorry,that wasn't a number.\n"; return EXIT_FAILURE; } if (miles <= 0 || miles >= 100) { cerr << "Sorry, that wasn't a legitimate number.\n"; return EXIT_FAILURE; } //3 dollars, plus 70 cents for each 1/5 of a mile. //double dollars {3.00 + .70 * 5 * miles}; double dollars {3.00 + 3.50 * miles}; //Simpler way to do the same //thing cout << dollars << "dollars\n"; return EXIT_SUCCESS; }