Question: Write a program in C following the below instructions: - Define a structure data type called product with these members: - Code, - Description, and
Write a program in C following the below instructions: - Define a structure data type called "product" with these members: - Code, - Description, and - Price. - This is the information that needs to be initialized for this structure: Code: 234567, Description: oranges, Price: $4.25. Code: 617890, Description: apples, Price: $2.10. Code: 129089 , Description: grapes, Price: $0.99. Code: 617890 , Deseription: pineapples, Price: $1,87. Code: 129089, Description: watermelons, Price: $3.12. - Prompt the user to enter how many items of each fruit are going to be bought. Note: use only one value for all fruits, not a single value for each fruit. - Example when the user wants to buy 5 items of each fruit: - How many items of each fruit would you like to buy? - Answer: 5 - Call a function called "printfruits" that receives the structure you initialized and the number of fruits to buy (value entered in the pee amount bought. Inside this function, you should use these arguments received to CALCULATE the total amount per fruit. - Print-out example: Oranges will cost Apples will cost Grapes will cost Pineapple will cost . Wotermelon will cost - Note: represents the total cost per fruit that the customer would likn to bux Examples "Pineapples will cost 9.35 " - Note: the item description printout must come from the structure information, not from a direct printout of a strin - Do not do this: printif"Oranges will cost 4 ?",...) usingt letters for fruit description. You must use a specifie - This function will return the total amount cost the use wils - Fxample: You will ay. USD for all these fruits
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
