Question: Question below needs to be done in standard C language not C++ NOTE: - Save your file as .c LAB OBJECTIVES At the end of

Question below needs to be done in standard C language not C++

NOTE: - Save your file as .c

LAB OBJECTIVES

At the end of this lab activity, the students should be able to:

? Use built-in functions from the math.h and string.h header files

? Create user defined functions to solve programming problems.

? Apply passing and return array of string to function.

Question below needs to be done in standard C language not C++NOTE: - Save your file as .c LAB OBJECTIVES At the endof this lab activity, the students should be able to: ? Use

DPD5211 PROGRAM DESIGN QUESTION 3 (Additional Exercise) Write the complete C program to calculate the grand total collected from the sales of homemade cookies. 0 In main() function : I Ask the user whether he/she wants to continue executing the program. I Repeat these processes as long as the choice is 'Y': (Use while loop) 0 0 000000 Callfunction menu() to display the menu. Get the user's name, choice and quantity. Check the user's choice (must be between 1, 2 or 3 ONLY, otherwise repeat to re-enter the choice). Call function get_item(...) and pass choice. Callfunction get_price(...) and pass choice. Calculate payment by multiplying price with quantity. Calculate the total payment. Keep track of how many of each item has been sold. Callfunction display(...) and pass user's name, item name, price, quantity and payment. 0 Ask the user again whether he/she wants to continue. I (Once the loop terminates) Display the summary by showing the total payment and also how many of each item has been sold. I In function menu() : I Display the menu as shown in the output screen. 0 In function get_item(...) : I Identify the item name using switch-case statement based on the choice. I Return the item name. I In function get_price(...) : I Identify the price of the item using switch-case statement based on the choice. I Return the item price. - In function display(...) : I Display all information as shown in the output screen. Note: Don't forget to write the function prototypes for all functions. Use fflush() when necessary. PD5211 PROGRAM DESIGN LAB 7 Enter [Y] to continue : Y WELCOME TO MYHome COOKIES 1. Chocolate Chip Cookies [ RM 25.00 ] 2 . Best selling Almond Cookies 23.00 3. Cranberry Oats Cookies [ RM 24.30 ] Enter name Amanda Enter choice 5 Sorry, wrong choice. Re-Enter choice : 2 Enter quantity : 3 RECEIPT OF PURCHASE Name : Amanda Item : Almond Cookie Price : RM 23.00 Quantity payment RM 69.00 Enter [Y] to continue : Y WELCOME TO MYHome COOKIES 1. Chocolate Chip Cookies 2 . 3 Best selling Almond Cookies [ RM 25.00 [ RM 23.00] Cranberry Oats Cookies RM 24.30 ] Enter name Bella Enter choice 1 Enter quantity : 4 RECEIPT OF PURCHASE Name Bella Item Choc-chip Cookie Price RM 25.00 Quantity 4 payment : RM 100.00 2DPD5211 PROGRAM DESIGN LAB 7 Enter [Y] to continue : N TODAY'S SUMMARY Total Payment Item 1 sold : RM 169.00 4 Item 2 sold Item 3 sold 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!