Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Table 2 shows the list of chocolate that had been sold during Christmas. Write a program to calculate the total price and number for all

Table 2 shows the list of chocolate that had been sold during Christmas. Write a program to calculate the total price and number for all the chocolate that has been sold. If the quantity sold is greater than 500 pieces/bar, the chocolate will be awarded as the best chocolate of the year . Display chocolates name, types of chocolate, weight, price, quantity, and finally display the awarded to the best chocolate of the year.

image text in transcribed

Requirement: (a) Define and declare struct chocolate with chocolateName (char), chocolateType (char), weigh t (int), price (float) and quantity (int) as its member. (b) Declare an array of structured chocolate name chocho to all the information for all types of chocolates name. (c) Design any possible and appropriate structure elements that you think is possible to solve this problem.

the answer in c programming

image text in transcribed

Table 2: List of chocolate sold during Christmas. Chocolate Name Weight (g) Price (RM) Types of Chocolate Quantity Dark Chocolate 340 20.00 850 Cadbury Dark Milk Selection Box Cadbury Old Jamaica 180 10.00 450 85 (box of 16) 110.00 300 Cadbury Dark Milk Salted Caramel White Chocolate 180 10.00 300 Cadbury White Chocolate Bar 120 7.50 500 Cadbury White Oreo Bar 110 9.50 250 Cadbury White Buttons Bag Milk Chocolate 105 8.50 190 Cadbury Dairy Milk Honeycomb and Nuts 69 5.50 780 Cadbury Roses Carton 300 16.50 430 Cadbury Dairy Milk Fruits & Nuts Sample Output: Enter Chocolate Name: Cadbury Dark Milk Selection Box Enter Type of Chocolate: Dark chocolate Weight (g): 340 Price (RM): 20.00 Quantity: 650 Chocolate Name Weight Price Quantity Award Type of Chocolate Dark Chocolate 340 20.00 650 Cadbury Dark Milk Selection Box Best chocolate of the year Cadbury Old Jamaica 180 10.00 450 Dark Chocolate White Chocolate Cadbury White Oreo Bar 120 7.50 500 Best chocolate of the year Cadbury Roses Carton Milk Chocolate 69 5.50 780 Best chocolate of the year White Chocolate 180 10.00 Cadbury White Chocolate Bar 300 Dark Chocolate Cadbury Dark Milk Salted Caramel 85 (box of 16) 110.00 300 Milk Chocolate 105 8.50 Cadbury Dairy Milk Honeycomb and Nuts 190 Cadbury Dairy Milk Fruits & Milk Chocolate 300 18.50 430 Nuts White Chocolate 110 9.50 Cadbury White Buttons Bag 250

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

More Books

Students also viewed these Databases questions

Question

Discuss the scope of financial management.

Answered: 1 week ago

Question

Discuss the goals of financial management.

Answered: 1 week ago