#include <iostream> //for cout
using namespace std; //for using cout instead ofstd::cout
int main () {
//constants
constdouble rs_discount_high = 0.7; //100%-30% = 70%
constdouble rs_discount_low = 0.9; //100%-10%= 90%
constdouble boundary = 200;
doublepurchase_ammount;
cout<< "Input purchase ammount: ";
cin>> purchase_ammount;
//coutwith if (trenary operation ?)
cout<< "Ammount to be paid: " <<
purchase_ammount*
(purchase_ammount> boundary ? rs_discount_high : rs_discount_low)
<<endl;
return0;
}
Comments
Leave a comment