Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

1. Walk to the child, look into his or her eyes.

Answered: 1 week ago