Question: Q2: # Named constants RETAIL_PRICE = 99 # Local variables quantity = 0 fullPrice = 0.0 discountRate = 0.0 discountAmount = 0.0 totalAmount = 0.0
Q2: # Named constants
RETAIL_PRICE = 99
# Local variables
quantity = 0
fullPrice = 0.0
discountRate = 0.0
discountAmount = 0.0
totalAmount = 0.0
# Calculate the discount rate
if quantity > 97 then discountRate = 0.40
if quantity > 47 then discountRate = 0.30
if quantity > 17 then discountRate = 0.20
if quantity > 7 then discountRate = 0.10
else
discountRate = 0
# Calculate the full price
quantity * RETAIL_PRICE
# Calculate the discount amount
# Calculate the total amount
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
