Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started