Question: THIS uses C only please help i Need this within the hour please help Write code for the struct header file named product.h that consists
THIS uses C only please help i Need this within the hour please help
Write code for the struct header file named "product.h" that consists of the following: header guard struct definition for Product which consists of 3 things: name (string of 10 characters), price (double value) and quantity (integer value) function prototypes for the following 3 functions: fil Product() - The function will take in two parameters: array by reference and the length of the array. The function will not return anything. The function will initialize all the quantity values to be equal to the length - index) * 10. The price values will be equal to (index * 2.5). All product names should be initialized to "sample". calculateAveragePrice() - The function will take in two parameters: array by reference and the length of the array. It will calculate the average price of all products, without considering the quantity of each product. This average value will be returned back by the function. o totalPrice() - The function will take in three parameters: array by reference, length of the array, and the double totalPrice value passed as a pointer which will be updated with the calculated value. The function will not return anything. The totalPrice value should be updated to contain the weighted sum of the total price of all prices considering the quantity of each product as well. For the toolbar, press ALT+F10 (PC) or ALT+FN+F10 (Mac). B I g Paragraph Arial 14px
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
