Answer to Question #281469 in Algorithms for SHERON

Question #281469

While purchasing certain items, discount is offered based on the below conditions. If quantity and price per item are input through the keyboard, write a pseudo code and draw a flowchart to calculate the total expenses.


1
Expert's answer
2021-12-20T09:57:10-0500
pseudo code


Declare Integer quantity
Declare Real price
Declare Real totalExpenses
Declare Real discount


Display "Enter price of the item: "
Input price
Display "Enter the quantity of the item: "
Input quantity
Set totalExpenses = price * quantity
If totalExpenses >= 6000 Then
    Set discount = 0.15 * totalExpenses
Else
    If totalExpenses >= 5000 AND totalExpenses < 6000 Then
        Set discount = 0.12 * totalExpenses
    Else
        If totalExpenses >= 4000 AND totalExpenses < 5000 Then
            Set discount = 0.08 * totalExpenses
        Else
            Set discount = 0.03 * totalExpenses
        End If
    End If
End If
Set totalExpenses = totalExpenses - discount
Display "The total expenses: ", totalExpenses




FlowChart

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS