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 tocalprice function. - Call discount function to make discount on the total price according to the amount of the product. 0. If the user enters 2, prompt the user to enter the kilogram of the product. Call totalprice 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: Hoat totalprice(float amount, float 1istprice); Calculates the total price. float discount(float total price, int anount); Returns the price after making the discount. Suppose that discount is shown 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!