Question: QUESTION 2 Given: struct order { char productID[6]; float unitPrice, grossTotal, netTotal, service Tax; int qtyOrdered; }; The system requirements are: Declare constant TAX, initialised
![QUESTION 2 Given: struct order { char productID[6]; float unitPrice, grossTotal,](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f3c3b8dd057_38466f3c3b84f7e1.jpg)

QUESTION 2 Given: struct order { char productID[6]; float unitPrice, grossTotal, netTotal, service Tax; int qtyOrdered; }; The system requirements are: Declare constant TAX, initialised to 0.08. In main(): Declare array myOrder of type struct order, set to size 50. Prompt the user to enter the number of orders for the day. Call function getInput(...), passing in array myOrder and number of orders as parameters. Call function processOrder(...), passing in array myOrder and number of orders as parameters. In getInput(...): o Get all required inputs (refer to sample output screen). In processOrder(...): o Calculate and display all the required outputs (refer to sample output screen). Note: Figure out and use the correct formulas required. Continued... Sample output screen ORDER PROCESSING ================ How many orders today? 3 Enter product ID : P1001 Enter unit price : RM 25.5 Enter quantity ordered : 2 Enter product ID : P1002 Enter unit price : RM 30 Enter quantity ordered : 4 Enter product ID : P1003 Enter unit price : RM 16.5 Enter quantity ordered : 3 ORDER : P1001 Unit Price : RM 25.50 Qty Ordered : 2 Gross Revenue : RM 51.00 Service Tax : RM 4.08 :: Net Revenue : RM 46.92 ORDER Unit Price Qty Ordered Gross Revenue Service Tax :: Net Revenue : P1002 : RM 30.00 : 4 : RM 120.00 : RM 9.60 : RM 110.40 ORDER : P1003 Unit Price : RM 16.50 Qty Ordered : 3 Gross Revenue : RM 49.50 Service Tax : RM 3.96 :: Net Revenue : RM 45.54 *TOTAL INCOME EARN :: RM 202.86 (a) Design the program using a problem analysis chart. (10 marks) (b) Design the program using a flowchart. (10 marks) (c) Write the complete C program. (20 marks) (Total: 40 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
