Question: please include system pause and return 0 at the end. thankyou Problem Write a program that calculates the sale price of products. The program design

please include system pause and return 0 at the end. thankyou  please include system pause and return 0 at the end. thankyou
Problem Write a program that calculates the sale price of products. The
program design should use a main and the below six functions. Consider

Problem Write a program that calculates the sale price of products. The program design should use a main and the below six functions. Consider the constant size with value equal to 4 and a one-dimensional array A_cost with size equal to size that represents the products cost in KWD. 1. Define a function O_read_4 that takes a 10 array A_cost and 1D array A_percentage as formal parameters. The function should perform the following: (20 points) Prompts the user to fill the array A_cost with the following product costs: 25.05 45.32 11.54 100.10 Prompts the user to fill the array A_percentage with product percentages increase as shown below 0.15 0.60 0.22 0.70 2. Define a function O_sale_4 that takes a 10 array A_cost, 10 array A_percentage and A_saleprice as formal parameters. The function should perform the followings: (15 points) Calculates sale price for each product in the array A_saleprice as shown below using the following formula: Sale Price - Cost X (1.percentage increase) 28.81 72.51 14.08 170.17 3. Define a function O_result_4 that takes a 10 array A_saleprice of size equal to SIZE as formal parameter. The function calculates and prints the cheapest and the expensive sale prices in the array A_saleprice as shown below: (15 points) The Cheapest item price is: 14.08 The Expensive item price is: 170.17 Page 2 of 4 4. Define a function O_afterdiscount_4 that takes a 10 array A_saleprice at site equal to SIZE as formal parameters. The function calculates the new prices after applying the following discounts (20 points) 3% discount if sale price greater than or equal 150 9% discount if sale price greater than 70 and less than 150 12% discount if sale price less than or equal 70 5. Define a function O_print_4 that takes A_cost, and A_saleprice as formal parameters and displays all arrays' elements as shown in the below sample output. (10 points) 6. Define a function O student_4 that displays your name, your CS 159 section number and your ID on the screen as shown in the below figure. (10 points) ********* Name: XOX YYYY Section! xx ID: 12445 ### 7. Write a main function that performs the following: (10 points) Define and initialize the arrays A_cost, ^_percentage and A_saleprice. Display the below sample output as by calling the following functions: O_read_4 O_sale_4, O_result_4 and O_print_4. A complete sample output of the program is given below in the figurer Page 3 of 4 Enter the product costs for four items :25.05 45.32 11.54 100.10 Enter the percentage for each item :0.15 0.60 0.22 0.70 COSTS OF THE ITEMS (KWD) Item 0 Item 1 Item 2 Item 3 25.05 45.32 11.54 109.10 PERCENTACE OF THE ITEM (KWD) Item @ Item 1 Item 2 Item 3 0.15 0.60 0.22 0.70 SALE PRICE OF THE ITEM (KWD) Item Item 1 Item 2 Item 3 28.81 72.51 14.08 170.17 CHEAPEST and EXPENSIVE ITEM PRICES The Cheapest item price is: 14.08 The Expensive item price is: 170.17 *****RESULTS AFTER APPLYING DISCOUNTS COSTS OF THE ITEMS (KWD) Item Item 1 Item 2 Item 3 25.05 45.32 11.54 100,10 PERCENTACE OF THE ITEM (KWD) Item Item 1 Item 2 Item 3 0.15 0.60 0.22 0.70 ---- SALE PRICE OF THE ITEM (KWD) Item Item 1 Item 2 Item 3 25.35 65.99 12.39 165.06 ### Name: XXX VYYY #### # Section! xx ID: 12445 Press any key to continue Page 4 of 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!