Question: C++ answer for this please By using while loop or do..while loop, write a program that displays a list of stationaries. Then, allow user to
C++ answer for this please
By using while loop or do..while loop, write a program that displays a list of stationaries. Then, allow user to insert number of item that they want to buy, the items code and quantity for each item. Finally, display the total price that the user needs to pay with two decimal points. The program should have an input validation where the number of item, item code and quantity must be positive values. Items code is only from 1 to 4. The program terminates when the user keys in 0.
Code Item Price 1 Ballpoint pen RM 2.50 2 Highlighter RM 3.40 3 Liquid paper RM 4.50 4 Note pads RM 3.20 Sample output Code Item 1 Ballpoint pen 2 Highlighter 3 Liquid paper 4 Note pads Price RM 2.50 RM 3.40 RM 4.50 RM 3.20 Enter number of product that you want to purchase (press 0 to exit) : -1 Wrong input Enter number of product that you want to purchase (press 0 to exit) : 2 1. Enter item's code that you want to buy : 3 1. Enter the quantity of item that you want to buy : 1 2.Enter item's code that you want to buy : 0 Please enter code 1 - 4 2.Enter item's code that you want to buy : 1 2.Enter the quantity of item that you want to buy : 0 Quantity must be at least 1. 2. Enter the quantity of item that you want to buy : 2 Total price is RM 9.50 Enter number of product that you want to purchase (press 0 to
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
