//OrinTill Qimid CS1A Chapter 4, P. 221, 10
//
/**************************************************************
* Calculate discount
*
* ____________________________________________________________
* This program will calcualte the discount base on the qunaity of purchase
* ____________________________________________________________
* INPUT
* Purchase : the quanity of purchases
* OUTPUT
* discount : the total amount after the discount
**************************************************************/
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
float Purchase,
discount;
cout<<"How many products did you purchase?"<<endl;
cin >> Purchase;
if (Purchase<10)
{
cout << "sorry purchase quanity too small no discount given"<<endl;
}
else if (Purchase >= 100)
{
discount = Purchase *99 * 0.50;
cout <<"congraulation you get a 50 percent discount! $"<< discount << " is your total price"<< endl;
}
else if (Purchase>=50)
{
discount = Purchase *99 * 0.40;
cout <<"congraulation you get a 40 percent discount! $"<< discount << " is your total price"<< endl;
}
else if (Purchase>=20)
{
discount = Purchase *99 * 0.30;
cout <<"congraulation you get a 30 percent discount! $"<< discount << " is your total price"<< endl;
}
else
{
discount = Purchase *99 * 0.20;
cout <<"congraulation you get a 20 percent discount! $"<< discount << " is your total price"<< endl;
}
return 0;
}