a) A local shop sells festival cookies at RM28.50 per box. The shop offers special discount for order of 20 boxes or more as shown belows: Number of boxes Discount on total price More than 100 25%...


C++ Programming


a) A local shop sells festival cookies at RM28.50 per box. The shop offers special discount for<br>order of 20 boxes or more as shown belows:<br>Number of boxes<br>Discount on total price<br>More than 100<br>25%<br>80-100<br>20%<br>50-79<br>15%<br>20-49<br>10%<br>Write a fragment of C++ code to accept the order quantity in boxes, then calculates and<br>displays the total discount (if applicable) and total cost of the order. Prompts error message if<br>invalid quantity is entered (zero or below). Display the total cost in 2 decimal places.<br>Sample program run 1:<br>Enter number of boxes you wish to order : -10<br>Sorry. Invalid order quantity.<br>Sample program run 2:<br>Enter number of boxes you wish to order: 50<br>Total discount is RM213.75<br>Total cost is<br>RM1211.25<br>

Extracted text: a) A local shop sells festival cookies at RM28.50 per box. The shop offers special discount for order of 20 boxes or more as shown belows: Number of boxes Discount on total price More than 100 25% 80-100 20% 50-79 15% 20-49 10% Write a fragment of C++ code to accept the order quantity in boxes, then calculates and displays the total discount (if applicable) and total cost of the order. Prompts error message if invalid quantity is entered (zero or below). Display the total cost in 2 decimal places. Sample program run 1: Enter number of boxes you wish to order : -10 Sorry. Invalid order quantity. Sample program run 2: Enter number of boxes you wish to order: 50 Total discount is RM213.75 Total cost is RM1211.25

Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here