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.
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
Comments
Leave a comment