LAB ACTIVITY 2: INTRODUCTION TO ALGORITHM DESIGN CSC121
OCT 2022
Instructions: From last week activity, draw a pseudocode and flow chart for each problem.
PROBLEM 1
Amelia wants to buy a can of Coke from a vending machine cost. The drink cost RM2.20.
The vending machine only take coins as payment. Amelia has 3 x 50cents coins and 4 x
20cents coins.
PROBLEM 2
Find the perimeter and area of a rectangle. The perimeter and area of the rectangle are
given by the following formulas:
Perimeter = 2 * (length + width)
Area = length * width
PROBLEM 3
Customer is eligible for free delivery coupon for first food order from UberPanda app. To
apply the coupon, customer need to type ‘THANKYOU’ on the promo column before
checkout.
PROBLEM 4
A muslimah hair salon is celebrating their 10th year anniversary. The owner decided to offer
15% discount for some hair styling services. For membership promo, customers will get
additional 10% discount. Below are price for the promotional services:
Scalp treatment : RM60
Rebonding : RM100
Manicure & Pedicure : RM50