Question: THIS USES C ONLY (please help i need this by the end of the hour help) Write code for the struct source file named product.c
THIS USES C ONLY (please help i need this by the end of the hour help)
Write code for the struct source file named "product.c" that consists of the following: includes for the header files function definitions for the following 3 functions: fillProduct() - 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 IV Paragraph Arial 14px
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
