Answer to Question #12023 in C++ for billy gesmundo
how to compute the discount and and the total purchase and output them?
Here is an example.
using namespace std;
double order, discount, price = 99;;
// order discounts
cout << "Enter the quantity for your order";
cin >> order;
// determine discount
if ((order > 10) && (order < 19))
& discount = 20;
else if ( order > 49)
& discount = 30;
else if ( order > 99)
& discount = 40;
else if ( order < 100)
& discount = 50;
// show discount percentage
cout << " your discount on this purchase is" << discount << ".\n";
double total = price * order - discount;
cout << " purchase is" << total <<".\n";
Need a fast expert's response?
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!
Learn more about our help with Assignments: C++
Leave a comment