// Medical Supply Store // Peter #include #include using namespace std; int main(){ // Variables int package, amount; double price, given, subtotal, balance, total; // Menu cout << "Medical Supply Store"; cout << "\n1. Deluxe Scrub Tops at $19.99 each"; cout << "\n2. Deluxe Scrub Pants at $22.99 each"; cout << "\n3. Value Set $18.99 each"; cout << "\nChoose one of the following or press any key to exit" << endl; cin >> package; // Validate package and assign price switch(package){ case 1: price = 19.99; break; case 2: price = 22.99; break; case 3: price = 18.99; break; default: cout << "\nInvalid package selection, Program will now end\n"; return 0; } // Ask for numbers of packages cout << "\nHow many packages do you want to buy? "; cin >> amount; if( amount < 0) { cout << "\nInvalid package amount, Program will now end\n"; return 0;} // Subtotal, Tax, and Total subtotal = (price * amount); cout << "\nYour subtotal is: $" << setprecision(2) << fixed << subtotal; cout << "\nThe tax rate is: 8%"; total = subtotal + (subtotal * 0.08); cout << "\nYour total is: $" << setprecision(2) << fixed << total; // Ask for amount given cout << "\n\nAmount given? "; cin >> given; if( given < total) { cout << "\nInvalid amount given, Program will now end\n"; return 0;} // Balance balance = (given - total); cout << "\nYour balance is: $" << setprecision(2) << fixed << balance << endl; return 0; }