Question: 1. Using the Linked List shown above, write a program that will compute the total cost purchased by a customer. The program has a menu
1. Using the Linked List shown above, write a program that will compute the total cost purchased by a customer. The program has a menu that will show the items and the prices. The program will ask the user the item to purchase and after the user chooses the item, the program will ask for the quantity purchased. The user can add more items or print the receipt unless the user chose to quit.
Note:
The ItemNo, Qty, and Price should be saved in the list. Since the program discussed above has only two data and a link to point to a node, you need to add one more data. It means the total data should be three (3) and a link to point to a node.
List of Products
| Item No. | Items | Price (Dhs) |
| 101 | T-Shirt | 70.25 |
| 102 | Polo | 160.75 |
| 103 | Long Sleeve | 250.45 |
| 104 | Pants | 300.35 |
| 105 | Shoes | 200.85 |
Menu
Enter Order
Print Receipt
Exit
Enter your choice: 1
Enter Item No.:101
Enter Quantity:2
----------------------------------------
Menu
Enter Order
Print Receipt
Exit
Enter your choice: 1
Enter Item No.:102
Enter Quantity:1
-----------------------------------------
Menu
Enter Order
Print Receipt
Exit
Enter your choice: 2
Item No. Price Qty Cost
1. Using the Linked List shown above, write a program that will compute the total cost purchased by a customer. The program has a menu that will show the items and the prices. The program will ask the user the item to purchase and after the user chooses the item, the program will ask for the quantity purchased. The user can add more items or print the receipt unless the user chose to quit.
Note:
The ItemNo, Qty, and Price should be saved in the list. Since the program discussed above has only two data and a link to point to a node, you need to add one more data. It means the total data should be three (3) and a link to point to a node.
List of Products
| Item No. | Items | Price (Dhs) |
| 101 | T-Shirt | 70.25 |
| 102 | Polo | 160.75 |
| 103 | Long Sleeve | 250.45 |
| 104 | Pants | 300.35 |
| 105 | Shoes | 200.85 |
Menu
Enter Order
Print Receipt
Exit
Enter your choice: 1
Enter Item No.:101
Enter Quantity:2
----------------------------------------
Menu
Enter Order
Print Receipt
Exit
Enter your choice: 1
Enter Item No.:102
Enter Quantity:1
-----------------------------------------
Menu
Enter Order
Print Receipt
Exit
Enter your choice: 2
Item No. Price Qty Cost
101 70.25 2 140.50
102 160.75 1 160.75
Total Cost: 301.25
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
