Write the program "order.c" that implements the header file "order.h". Namely, do the following:
1- implement the function read_item.
2- implement the function read_order.
3- implement the function get_menu_item.
4- implement the function calc_total.
5- implement the function save_receipt.
6- implement the function main.
Note 1: All arrays must be allocated dynamically.
Note 2: Attach the file "order.c" as your answer.
Files: order.h , [login to view URL]
/* A pizzeria has the following menu
each item on the menu has an id, a description, and a price */
struct MenuItem{
int mi_id;
char mi_desc[100];
float mi_price;
} menu[10] = {
{113, "Small cheese pizza", 10.00},
{114, "Medium cheese pizza", 20.00},
{115, "Large cheese pizza", 30.00},
{123, "Small veggi pizza", 10.00},
{124, "Medium veggi pizza", 20.00},
{125, "Large veggi pizza", 30.00},
{311, "6pc chicken wings", 12.00},
{312, "12pc chicken wings", 20.00},
{411, "Garlic bread", 5.00},
{611, "Cola", 2.00}
};
/* An order item stores the item's id and quantity */
typedef struct Item{
int item_id;
int quantity;
} Item;
/* An order consistes of the name of the customer, number of
ordered items, array of ordered items, the value added tax
as a percentage to be applied to the total of the orders,
and a delivery fee to be added to total after applyint the
tax */
struct Order{
char customer_name[100];
int items_count;
Item* items;
float vat;
float delivery_fees;
};
/* read_item reads an order item information from the keyborad
and returns a pointer to the read item */
Item* read_item();
/* read_order reads all information of the order from the
keyboard and returns a pointer to the read order */
struct Order* read_order();
/* get_menu_item takes a menu item's id and returns a structure
contains all details about this item from the menu */
struct MenuItem get_menu_item(int id);
/* calc_total takes an order and returns the total amount that
should be paid by the customer for this order*/
float calc_total(struct Order* or);
/* save_receipt takes a file name fn and an order or and saves
the corresponding receitpt to the text file fn in the following
format:
Welcome: Ahmad Ali
**********************************
Item# Description Quantity Price
------------------------------------------------------------------
115 Large cheese pizza 2 30.00
124 Medium veggi pizza 2 20.00
411 Garlic bread 3 5.00
611 Cola 3 2.00
------------------------------------------------------------------
VAT: 0.05
Delivery fees: 10.00
------------------------------------------------------------------
Total: 137.05
*/
void save_receipt(char* fn, struct Order* or);
/* main function reads an order from the keyboard and saves its receipt
to the file "[login to view URL]", you can use the text of the file "[login to view URL]"
as a test input */
int main();
Hi there,I'm biddin on your project "c program oreder.c"
I have read your project description and i'm an expert in C programming and machine learning therefore i can do this project for you perfectly.I still have a few questions. please leave a message on my chat so we can discuss the budget and deadline of the project.
Thanks.
..
.
Hi there,
I'm bidding on your project "c program oreder.c"
Being an expert in C, and C++ programming I can do this project for you. please leave a message on my chat so we can discuss the budget and deadline of the project. Also, have a look at my profile for my reviews and portfolios. Thanks
Note: This is not an automated bid and i'm ready to discuss your project right now.
..
.
###### Experienced in C, Python, Data structure, Algorithm Design and Analysis ########
Hi, Greetings.
I am a computer engineer having masters in Mathematics, Computer Science and PhD in Computer Science. I have more than 10 years experience in developing algorithms of mathematical problems as well as computer related problems and their implementation using C, C++, Java, Python programming language.
I would like to discuss in more detail with you to get your exact requirements. I am confident I can provide you efficient solution.
Here I put a tentative bid amount and days that can be fixed after understanding the project details.
I'm looking forward to your response.
Best regards,
✔️ Dear Client.
I am seeing your repeated post.
Being top-notch C/C++ programmer, I would like to work on your project.
We can discuss more detail over chat.
Thanks for reading my proposal.