Question: PLEASE provide an answer in PHP programming: - 2 parameters: price and quantity - create a numeric array of discounts with the following values: 0,0,.05,.1,.2,.25

PLEASE provide an answer in PHP programming:

- 2 parameters: price and quantity

- create a numeric array of discounts with the following values: 0,0,.05,.1,.2,.25

- get the discount percent from the array using the quantity as the index. If the quantity is greater than 5, use 5 as the index.

- calculate the discount price using the discount percent calculate the total by multiplying the discount price by the quantity

- return the total to the calling script

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!