Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE HURRY!!! Task 6: Write a main function to perform the following tasks: (5 marks) a) Declare one-dimensional array variable with 50 elements for a
PLEASE HURRY!!!
Task 6: Write a main function to perform the following tasks: (5 marks) a) Declare one-dimensional array variable with 50 elements for a structure type Item. b) The function may need to call the functions that are defined in the previous task to produce the output as shown in Figure 4. Note: Please use proper output formatting c) Figure 4 shows the complete output that will be displayed on the screen based on the data in the input file "input.txt" shown in Figure 1. CODE ITEM NAME COST (RM) SALE (RM) QUANTITY PROFIT (RM) M101 B202 C303 F404 F404 C303 B202 M101 M101 C303 B202 F404 M101 C303 B202 Double Mushroom Double BBQ Beef Grilled Chicken Fish'n Crisp Fish'n Crisp Grilled Chicken Double BBQ Beef Double Mushroom Double Mushroom Grilled Chicken Double BBQ Beef Fish'n Crisp Double Mushroom Grilled Chicken Double BBQ Beef 11.50 10.20 7.00 6.25 6.25 7.00 10.20 11.50 11.50 7.00 10.20 6.25 11.50 7.00 10.20 14.95 13.26 9.10 8.12 8.12 9.10 13.26 14.95 14.95 9.10 13.26 8.12 14.95 9.10 13.26 12 21 15 9 27 25 16 9 14 26 31 13 9 38 33 41.40 64.26 31.50 16.88 50.62 52.50 48.96 31.05 48.30 54.60 94.86 24.38 31.05 79.80 100.98 ITEM NAME Double Mushroom Double BBQ Beef Grilled Chicken Fish'n Crisp TOTAL PROFIT (RM) 151.80 309.06 218.40 91.88 The total amount of profit = RM 527.46 Highest profit = RM 309. Figure 4: Complete output for the data from the input file "input.txt" Task 6: Write a main function to perform the following tasks: (5 marks) a) Declare one-dimensional array variable with 50 elements for a structure type Item. b) The function may need to call the functions that are defined in the previous task to produce the output as shown in Figure 4. Note: Please use proper output formatting c) Figure 4 shows the complete output that will be displayed on the screen based on the data in the input file "input.txt" shown in Figure 1. CODE ITEM NAME COST (RM) SALE (RM) QUANTITY PROFIT (RM) M101 B202 C303 F404 F404 C303 B202 M101 M101 C303 B202 F404 M101 C303 B202 Double Mushroom Double BBQ Beef Grilled Chicken Fish'n Crisp Fish'n Crisp Grilled Chicken Double BBQ Beef Double Mushroom Double Mushroom Grilled Chicken Double BBQ Beef Fish'n Crisp Double Mushroom Grilled Chicken Double BBQ Beef 11.50 10.20 7.00 6.25 6.25 7.00 10.20 11.50 11.50 7.00 10.20 6.25 11.50 7.00 10.20 14.95 13.26 9.10 8.12 8.12 9.10 13.26 14.95 14.95 9.10 13.26 8.12 14.95 9.10 13.26 12 21 15 9 27 25 16 9 14 26 31 13 9 38 33 41.40 64.26 31.50 16.88 50.62 52.50 48.96 31.05 48.30 54.60 94.86 24.38 31.05 79.80 100.98 ITEM NAME Double Mushroom Double BBQ Beef Grilled Chicken Fish'n Crisp TOTAL PROFIT (RM) 151.80 309.06 218.40 91.88 The total amount of profit = RM 527.46 Highest profit = RM 309. Figure 4: Complete output for the data from the input file "input.txtStep 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