Question: Please program in C Consider a retail store where five different items are sold. The ID, price and discount percentage of each item is provided
Please program in C


Consider a retail store where five different items are sold. The ID, price and discount percentage of each item is provided in the table below: Item ID Price Discount 2 5801 12.59 10.95 10% 5802 5803 4.02 50% 5805 20.68 Calculate the price of all items before discount, after discount, subtotal (the total before tax), total t and final total of all the purchase made by a customer. Create three functions and a main function Details of each function are given below. 1) Main function Declare the array item IDO, item price and discounted item pricell of type double with 10 elements Prompt the user to enter the number of items purchased and store it in a variable. Since the store sells 5 items only, validate this number to be in the range of 0-5. Call functions getltemID, calculateltemPrice, calculateTotalPrice from the main and let all these functions be of type void. Add a loop in main that allows the user to repeated the same until he/she chooses to exit 2) getitemID function nputs to this function are number of items and item IDIT Prompt the user to enter the item IDs in the range of 5801-5805 and store it in an array type variable. Perform validation to make sure the entered IDs are in the range 3) calculateltemPrice function Inputs to this function are number of items, item IDO, item pricel] and discounted item pricel] Using the information from the table above, store the price values of respective item ID the array element item price O Calculate the price after discount the percentage and store the value in the array variable discounted item pricel] Print the values of item_pricell and discounted item price only for the item ID's entered by the user. 4) calculate Total Price function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
