#include #include using namespace std; int main() { int washer {0}; cout << "How many quarters do you need for the washer? "; cin >> washer; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_FAILURE; } int dryer {0}; cout << "How many quarters do you need for the dryer? "; cin >> dryer; if (!cin) { cerr << "Sorry, that wasn't a number.\n"; return EXIT_FAILURE; } int pennies {25 * (washer + dryer)}; //total cost, in pennies int dollars {pennies / 100}; int cents {pennies % 100}; cout << "That's " << dollars << " dollar"; if (dollars != 1) { //if dollars is not equal to 1 cout << "s"; //make dollars plural } if (cents > 0) { //if cents is greater than 0 cout << " and change"; } cout << ".\n"; //period at the end of the sentence return EXIT_SUCCESS; }