Question #313008

A customer goes and purchases some items at A & R. The store is offering discount to their customers. If a customer spends less than a $100, he/she will only get 5%. If the customer spends $100 or more, but less than $200, he/she will get 10% discount. If the customer spends $200 or more, he/she will get 20% off. Read the amount the customer spent at A&R. Calculate and print the discount amount and the final price after the discount has been deducted.


Expert's answer



Start
    Declare Real amount
    Declare Real discount 
    Display "Enter the amount the customer spent at A&R: "
    Input amount
    if amount<100 then
        discount =amount*0.05
    else if amount>=100 and amount<200 then
        discount =amount*0.1
    else if amount>=200 then
        discount =amount*0.2
    end if
    amount=amount-discount 
    Display "The discount"+discount 
    Display "The final price after the discount"+amount
Stop
LATEST TUTORIALS
APPROVED BY CLIENTS