Question: with stdio.h Write a program (main) that gives a discount on products. Prompt the user to enter the product number. Prompt the user to enter

with stdio.h
with stdio.h Write a program (main) that gives a discount on products.

Write a program (main) that gives a discount on products. Prompt the user to enter the product number. Prompt the user to enter either 1 (for amount) or 2 (for kilogram). Call get_price function. If the user enters 1 , prompt the user to enter the quantity of product. Call totalprice function. - Call discount function to make discount on the total price according to the amount of the product. o. If the user enters 2 , prompt the user to enter the kilogram of the product. Call tocalprice function. - No discount Display the total payment. The program has three functions: get price, totalprice, and discount. Here are the prototypes for the three functions: float get_price(int productNo, int amountType); Returns the list price of the product. Suppose that product has the list price shown in the following table: float totalprice(float anount, float 11stPrice); Calculates the total price. float discount(float total price, int asount); Returns the price after making the discount. Suppose that discount is ahown in the following table

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 Databases Questions!