Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A retail store is having a customer appreciation sale. Depending on the total do

ID: 674573 • Letter: A

Question

A retail store is having a customer appreciation sale. Depending on the total dollars purchased, the customer could receive a discount on his or her total purchases. Develop C# code that will obtain the total dollars purchased from the user, determine the discount percentage, and display the total amount due. When the purchases are more than $200, the discount is 20%. When the purchases are $200 or less, the discount is 10%.

Create a function called calcDiscount that will calculate and return the discount amount. Write the function and call it in the code.

Explanation / Answer

function calcDiscount(total)
if total > 200 then
calcDiscount = 20
else
calcDiscount = 10
endif
end

start
total_purchased = input "Enter total dollars purchased"
discount = calcDiscount(total_purchased)
amount_due = total_purchased * discount / 100
display "Total amount due is" amount_due
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote