You are on page 1of 5

Case 1

Aswan has RM100 in his pocket. He bought two item with different prices. Calculate the balance that is left.

Phase
1
To calculate the balance after TWO item are bought within RM100.
2 I:
Price 1, Price 2

P:
1. Amount in hand;
Money = 100

2. Calculate Balance;
Balance = Money - (Price 1 + Price 2)

O:
Display balance;
Balance

3 Algorithm

1.Receive input from Azwan for two prices

2.Intialize amount for two item

3.Calculate total price

4.Calculate balance of two item


Balance=RM100-total price

5.Display balance of two prices


Case 2
To calculate the bonus that employee receive from employee input salary given bonus to be of 20% of the salary.

Phase
1 To calculate the balance after TWO item are bought within RM100.

2 Input(I)
Salary

Process(P)
1)Calculate Bonus;
Salary*20%

Output(o):
Display Bonus;
Bonus

3 Algorithm

1.Receive input from employee salary

2.Intialize bonus 20% of the salary

3.Calculate the bonus


Bonus=Salary

4.Display the bonus of employee salary

Case 3
To calculate the total to be paid by the customer after given 10% discount from the total input price from user.

Phas
e
1 Required payment after 10% discount from user input.
2
Input(I):
(Total Price)

Process(P):
1)Calculate required payment after 10% discount.
Total price* 90%

Output(O):
Display required payment;
Required payment

3 Algorithm

1.Receive input price from user

2.Declare total price after 10% discount

3.Calculate the total to be paid


Payment=Total price*10 percent

4.Display total payment for price

You might also like