Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program in C following the below instructions: - Define a structure data type called product with these members: - Code, - Description, and

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction To Data Mining

Authors: Pang Ning Tan, Michael Steinbach, Vipin Kumar

1st Edition

321321367, 978-0321321367

Students also viewed these Databases questions

Question

2-1. What are six characteristics of effective teams? [LO-1]

Answered: 1 week ago