An online retailer sells five products whose retail prices are as follows: Product 1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49 and product 5, $6.87. Write an application that reads...


An online retailer sells five products whose retail prices are as follows:<br>Product 1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49 and product 5, $6.87.<br>Write an application that reads a series of pairs of numbers as follows:<br>a) product number<br>b) quantity sold<br>Your program should use a switch statement to determine the retail price for each<br>product. It should calculate and display the total retail value of all products sold. Use a<br>sentinel-controlled loop to determine when the program should stop looping, until<br>product number not equal to 0 and display the final results.<br>The Output as shown:<br>Enter product number (1-5 or 0 to stop): 1<br>Enter quantity sold: 5<br>Enter product number (1-5 or 0 to stop): 5<br>Enter quantity sold: 3<br>Enter product number (1-5 or 0 to stop): 4<br>Enter quantity sold: 4<br>Enter product number (1-5 or 0 to stop): 3<br>Enter quantity sold: 6<br>Enter product number (1-5 or 0 to stop): 5<br>Enter quantity sold: 2<br>Enter product number (1-5 or 0 to stop): 0<br>Total retail value of all products sold is: SR 127.09<br>

Extracted text: An online retailer sells five products whose retail prices are as follows: Product 1, $2.98; product 2, $4.50; product 3, $9.98; product 4, $4.49 and product 5, $6.87. Write an application that reads a series of pairs of numbers as follows: a) product number b) quantity sold Your program should use a switch statement to determine the retail price for each product. It should calculate and display the total retail value of all products sold. Use a sentinel-controlled loop to determine when the program should stop looping, until product number not equal to 0 and display the final results. The Output as shown: Enter product number (1-5 or 0 to stop): 1 Enter quantity sold: 5 Enter product number (1-5 or 0 to stop): 5 Enter quantity sold: 3 Enter product number (1-5 or 0 to stop): 4 Enter quantity sold: 4 Enter product number (1-5 or 0 to stop): 3 Enter quantity sold: 6 Enter product number (1-5 or 0 to stop): 5 Enter quantity sold: 2 Enter product number (1-5 or 0 to stop): 0 Total retail value of all products sold is: SR 127.09

Jun 11, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here