Question: In this lab you will write a program in C language for a flower and candy shop. Ask the user whether they want a flower
In this lab you will write a program in C language for a flower and candy shop. Ask the user whether they want a flower bouquet, a candy box, or both. Define a struct for flower and a struct for candy. The flower structure must contain the flower name, flower quantity and the price of each flower. The candy structure must contain the candy name, candy quantity, and the price of one piece of candy. Depending on the answer provided by the user prepare the flower bouquet and/or the candy box. The bouquet will simply be an array of flower items and the candy box will simply be an array of candy item. Write the flowing functions to support your program: 1. void makeBouquet(flower bouquet[], int length, float* price) 2. void showBouquet(flower bouquet[], int length) 3. void makeCandyBox((candy box[], int length, float * price) 4. void showCandyBox((candy box[], int length) Save the struct and function definitions in a file shop.h. In another file name shop.c provide functionality for this methods. In your main file you can call it giftshop.c include these files as appropriate and then ask the user whether they want a flower bouquet, a candy box, or both. Depending on their answer call the appropriate methods and display the total price of their purchase. A sample run is as follows: Please choose from the following options: . Only Bouquet 6. Onty CandyBox . both How nany ftowers do you want in your boquet : 3 Please enter the nane of the flower: rose Please enter the price of one flower: 2.55 How many rose do you want: 3 Please enter the name of the flower : 1tlly Please enter the price of one flomer: 2.45 How many lilly do you want: 2 Please enter the name of the flower: patsy Please enter the price of one flower: .78 How many Dalsy do you want: 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
