[Solved]Intro C Programming Please Show Notes Make Sure Follow Program Like Part Gonna Used Foll Q37249793
Intro to C programming,
Please show some notes to make sure I follow the program. Likethis.
//what this part is gonna do
and so on.
I have used the following, for loops, while loops, strings,arrays. conditionals, pointers, structs and enums
Thank you in advance! You are the best!
PS
orders.db has to be accessed using the read_orders functiongiven.
A link for the files you may need are here:
https://drive.google.com/drive/folders/1G6vz7dvvJZnkqxMZV1qs-ZLg142ESBMZ?usp=sharing


In this homework, you will do some simple operations using structs. Download the hw5.c, orders.c, orders.h, and orders.db files from HuskyCT and put them in your working directory This is the skeletal code in hw5. c that you will need to complete #include #include #include <stdio.h> <stdlib . h> “orders . h” struct product products[] 1234, “Bread”, 2.99 , 5678, “Milk”, 4.19, 9012, “Eggs, 3.49, 3456, “Butter”, 3.99 , 7890, “Juice”, 2.49 , 2345, “Muffin”, 1.49 int main () short num orders; struct order *orders = read orders (“orders. db”, &num orde r s); if (orders-= NULL) { printf (“Order database does not existn”) The orders.db file contains a database of orders with customer names and a list of items. I have provided the read orders function for you to read the contents of the file and put it in an array of struct order called orders. You can look in orders.h to see the definition of struct order. Also, within struct order is another array of structs -this one is an array of struct item. The definition of struct item is also in orders.h. Each struct item contains a product sku and a quantity. The product sku refers to a product in the products array which is an array of struct product where each product has a sku, name, and price Your task for this homework is to complete the main function such that it iterates over the orders array, and for each order, print the order ID, customer name, and print out all the items for that order, and then calculate and print out the total cost of the order. The output for each order should look something like the following Order ID 1000 Name: John Doe Butter Muffin Total- 6.97 1 3.99 2 2.98 For each item, you will need to print out the product name, the quantity, and the cost (i.e. quantity multiplied by product unit cost). You will need to use the sku to find the product struct which will give you the product name and cost. To do so, iterate through the products array until you find the product with the matching sku In order to compile the program, you need to make sure that both the.c files and the .h file are in the same directory. Then, you can compile the program by simply doing the following: % gcc -o hw 5 hw5.c orders . c To run the program, run as you have been doing for previous programs. Just make sure that the orders.db file is in the same directory. Show transcribed image text In this homework, you will do some simple operations using structs. Download the hw5.c, orders.c, orders.h, and orders.db files from HuskyCT and put them in your working directory This is the skeletal code in hw5. c that you will need to complete #include #include #include “orders . h” struct product products[] 1234, “Bread”, 2.99 , 5678, “Milk”, 4.19, 9012, “Eggs, 3.49, 3456, “Butter”, 3.99 , 7890, “Juice”, 2.49 , 2345, “Muffin”, 1.49 int main () short num orders; struct order *orders = read orders (“orders. db”, &num orde r s); if (orders-= NULL) { printf (“Order database does not existn”) The orders.db file contains a database of orders with customer names and a list of items. I have provided the read orders function for you to read the contents of the file and put it in an array of struct order called orders. You can look in orders.h to see the definition of struct order. Also, within struct order is another array of structs -this one is an array of struct item. The definition of struct item is also in orders.h. Each struct item contains a product sku and a quantity. The product sku refers to a product in the products array which is an array of struct product where each product has a sku, name, and price Your task for this homework is to complete the main function such that it iterates over the orders array, and for each order, print the order ID, customer name, and print out all the items for that order, and then calculate and print out the total cost of the order. The output for each order should look something like the following Order ID 1000
Name: John Doe Butter Muffin Total- 6.97 1 3.99 2 2.98 For each item, you will need to print out the product name, the quantity, and the cost (i.e. quantity multiplied by product unit cost). You will need to use the sku to find the product struct which will give you the product name and cost. To do so, iterate through the products array until you find the product with the matching sku In order to compile the program, you need to make sure that both the.c files and the .h file are in the same directory. Then, you can compile the program by simply doing the following: % gcc -o hw 5 hw5.c orders . c To run the program, run as you have been doing for previous programs. Just make sure that the orders.db file is in the same directory.
Expert Answer
Answer to Intro to C programming, Please show some notes to make sure I follow the program. Like this. //what this part is gonna d… . . .
OR

