Question: C++ struct,arrays & loop, very simple Virgin Atlantic is developing an In-flight Vending App which will offer the following highend products on its menu: Rolex
C++
struct,arrays & loop, very simple
Virgin Atlantic is developing an In-flight Vending App which will offer the following highend products on its menu: Rolex Watch $1099.00 MacBook Pro $1299.00 Mens Cufflinks $ 499.00 IPad Pro 11-in $ 799.00 Ladies Ring $ 999.00 Watch S4 $ 399.00 You are asked to write a program that takes product orders based on this menu, produces each orders total, and summarizes the end-of-day information as described below. Program Requirements: The program must store the following data about each menu item in a structure called menuItem: A description of the menu item The price of the menu item A count of the number of times the item has been ordered 2 The program must keep an array of these structures, with one array element per menu item. When the program runs, it must initialize the array using the data above, and 0 for the count. The logic of the program must be the following: Show the user the different In-flight products offered by the vending app (display the menu). Allow the user to select multiple items from the menu (by item number, separated by space, with a 0 to end the order selections). Calculate and print the bill (including sub-total, tax, and total). The tax rate is 8.25% (not duty free!). Then, it must ask the user to enter: o N to add a new order (repeat the steps above for a new order), or o E to exit. Once the user selects E, the program must output end-of-day information consisting of: o the total amount of sales (the sum of all the orders), and o the description and count of the item that was ordered the most frequently.
Output
[1] Rolex Watch $1099.00 [2] MacBook Pro $1299.00 [3] Mens Cufflinks $ 499.00 [4] iPad Pro 11-in $ 799.00 [5] Ladies Ring $ 999.00 [6] Watch S4 $ 399.00 Input the item numbers for the order, 0 to quit 2 0 Subtotal...$ 1299.00 Tax........$ 107.17 Total......$ 1406.17 Please enter 'N' to take a new order and 'E' to exit: N [1] Rolex Watch $1099.00 [2] MacBook Pro $1299.00 [3] Mens Cufflinks $ 499.00 [4] iPad Pro 11-in $ 799.00 [5] Ladies Ring $ 999.00 [6] Watch S4 $ 399.00 Input the item numbers for the order, 0 to quit 1 6 0 Subtotal...$ 1498.00 Tax........$ 123.59 Total......$ 1621.59 Please enter 'N' to take a new order and 'E' to exit: N [1] Rolex Watch $1099.00 [2] MacBook Pro $1299.00 [3] Mens Cufflinks $ 499.00 [4] iPad Pro 11-in $ 799.00 [5] Ladies Ring $ 999.00 [6] Watch S4 $ 399.00 Input the item numbers for the order, 0 to quit 1 2 3 4 7 0 *Error: There is no item 7. Processing other items... Subtotal...$ 3696.00 Tax........$ 304.92 Total......$ 4000.92 Please enter 'N' to take a new order and 'E' to exit: E *** End of Day: Total sales: $7028.67 Item ordered most often: Rolex Watch was purchased 2 times.
three functions only
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
