76 817
Assignments Done
Successfully Done
In June 2019

Answer to Question #48367 in C++ for ankita

Question #48367
in shop rs 30 discount if the purchase amount is more than 200 otherwise give rs10 discount display amount to be paid
Expert's answer
#include <iostream> //for cout

using namespace std; //for using cout instead ofstd::cout

int main () {
constdouble rs_discount_high = 0.7; //100%-30% = 70%
constdouble rs_discount_low = 0.9; //100%-10%= 90%
constdouble boundary = 200;


cout<< "Input purchase ammount: ";
cin>> purchase_ammount;

//coutwith if (trenary operation ?)
cout<< "Ammount to be paid: " <<
(purchase_ammount> boundary ? rs_discount_high : rs_discount_low)


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions