Question: Complete the program to compute discount rate based on purchase amount and customer status, according to the following table Purchase Amount Discount Rate Less than

Complete the program to compute discount rate based on purchase amount and customer status, according to the following table

Purchase Amount Discount Rate Less than 50 0% 50 or more, less than 150 10% 150 or more, less than 500 15% 500 or more, less than 1000 20% 1000 or more 25%  

Any customer who is a special customer and is receiving a discount of 20% or more gets an additional 2% discount For example, a special customer who makes a $300 purchase receives a 15% discount. A special customer who makes a $700 purchase gets 20% plus the additional 2%, for a total discount of 22%.

In your program first use if..else if..else method to calculate the discount based on purchase amount. Then follow that with a single if statement with a logical operator to assign the 2% extra, if valid.

Additional information: Dealing with percentages is usually done with the fractional value ( 0.05 for 5%, for example) so that calculations can be easily done. Note how the provided code multiplies the fraction by 100 in the printf( ) to get a displayable percentage value.

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!