Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I've write C++ program but the output shows nothing Problem 70 Marks Dynamic Restaurant is a new restaurant operating in Skudai, Johor. The restaurant offers
I've write C++ program but the output shows nothing
Problem 70 Marks Dynamic Restaurant is a new restaurant operating in Skudai, Johor. The restaurant offers three main menus that are Seasonal Fruit Box, Grilled Peri Peri Chicken with Bean Salad, and Mongolian Stir Fried Beef with Baby Bok Choy and Fragrant Rice. Each week the sales manager should provide a weekly sales report. However, he faced difficulties with an increasing number of sales each day. Therefore, write a complete C + program that can assist the sales manager to provide a weekly sales report for Dynamic Restaurant. Table 1 below shows the three main menus and the respective code of the mem. The menu's code is a four-digit integer mimber, where the last two digits represent the price of the menu. For example, the menu's code of 3314 means that the price of the menu is RM14.00. Notes: You may use the modulus operator or the selection instructions to get the price of the menu from its code Table 1: List of menus Menu Code Seasonal Fruit Box 3314 Grilled Peri Peri Chicken with Bean Salad 1118 Mongolian Beef with Stir Fried Baby Bok Choy and Fragrant Rice 2220 In order to boost the sales, the restaurant offers 5% of discounts from the gross amount for each order with the quantity more than or equal to 15. The customers also need to pay 6% of additional charges for the Good and Services Tax (GST) for all the memus except the memi with the code of 3314. The GST is calculated based on the amount after deducting the discount The input of the program should be read from a file. The file contains a list of sales, in which each sale (1.e., each line) is represented by the code and the quantity of the ordered menu. Examples of the input files are shown in Figure 1(a) and 2(a). Notes: The input data are read from the file until the menu's code equals to the value of zero. The output of the program should be displayed into another file. Examples of the output files can be seen in Figure 1(b) and 2(b). The output file should include the following information: a) Sales Details: the list of sales, where each sale consists of the menu's code quantity of the ordered memu, price of the menu gross amount of charges to the customer (1.e. the amount before the GST and discount are included) discount rate given to the customer, GST rate and nett amount paid by the customer (i.e., inclusive of GST and discount). b) The sales statistics, which shows the total quantity of orders for each menu. c) The weekly total sales (1.e., inclusive of the discounts and GSTS). The assessment criteria are as shown in Table 2. 1118 5 2220 8 3314 20 3314 12 1118 30 33149 1110 10 (a) Input file named "input1.txt" Dynamic Restaurant's Weekly Sales Report :: SALES DETAILS: ES Code Quantity Price (RM) Amount (RM) Discount() GST Total (RM) 1118 2220 3314 3314 111 3314 1118 5 B 20 12 30 9 10 18.00 20.00 14.00 14.00 18.00 14.00 18.00 90.00 160.00 280.00 168.00 540.00 126.00 180.00 0.00 0.00 5.00 0.00 5.00 0.00 0.00 6.00 6.00 0.00 0.00 95.40 169.60 266.00 168.00 543.78 126.00 190.00 0.00 6.00 EE ::SALES STATISTICS:: ====== Code Total Quantity 1118 2220 3314 @ Total Sales = RM 1559.58 (b) The output file for the input file "imput1.txt" Figure 1: First example run 4 3314 12 1118 5 3314 20 3314 9 1118 10 2220 4 1118 7 3314 16 2220 10 2220 13 1110 10 3314 14 3314 8 1118 9 (a) Input file named "input2.txt" Dynamic Restaurant's Weekly Sales Report :: SALES DETAILS:: Code Quantity Price (RM) Amount (RM) Discount () GST Total (RM) 12 5 20 10 3314 1118 3314 3314 1118 2220 1110 3314 2220 220 111 3314 3314 1118 7 16 18 13 10 14 14.00 18.00 14.00 14.00 16.00 20.00 18.00 14.00 20.00 20.00 18.00 14.00 14.00 18.00 168.00 90.00 280.00 126.00 180.00 80.00 126.00 224.00 360.00 260.00 180.00 196.00 112.00 162.00 0.00 0.00 0.00 6.00 5.00 0.00 0.00 0.00 0.00 6.00 0.00 6.00 0.00 6.00 5.00 0.00 5.00 6.00 0.00 6.00 0.00 6.00 0.00 0.00 0.00 0.00 0.00 6.00 168.00 95.40 266.00 126.00 190.80 84.80 133.56 212.80 362.52 275.60 190.80 196.00 112.00 171.72 :: SALES STATISTICS:: Code Total Quantity 1118 2220 3314 41 35 79 Total Sales = RM 2586.00 () The output file for the input file "input2.txt" Figure 2: Second example run Program - incomplete.cpp SimpleProgram-complete.cppsetw.cpp #includeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started