You are on page 1of 5

ACTIVITY 2C: Problem Solving Methods

Duration: 2 Hours

Learning Outcomes
This lab activity encompasses activities 2C.1, 2C.2 and 2C.3

By the end of this practical session, you should be able to:


1. Write an algorithm.
2. Identify the various types of algorithm (Pseudo code).

CASE STUDY

Infinity Design Solution Sdn. Bhd, an advertising company wants to automate the system of managing Human
Resources (HR) data. Cik Suria was selected to be an IT programmer for Infinity Design Solution. En. Mohamed
insist to develop a system to manage staff payroll. Cik Suria has to prepare a proposal for payroll system.

INSTRUCTION:
1. You have been assigned to help Cik Suria to prepare a proposal which include:
 System design (algorithm and pseudo code )

Activity 2C.1
Activity Outcome: System design (algorithm and pseudo code )
Duration : 50 minutes

Cik Suria ask you to proceed with system design. You have to write an algorithm for problem analysis created
before. You do some research on algorithm as examples below:

PROBLEM PROBLEM ANALYSIS PROBLEM DESIGN (ALGORITHM)


Problem 1: Input: 3 numbers 1. Enter 3 numbers
Calculate total of three numbers Process : Calculate total of 2. Calculate total of three numbers
three numbers by add all 3 3. Display total of three numbers
numbers
Output : total of three
numbers
Problem 2: Input: birth year, current year 1. Enter birth year, current year
Calculate age Process : Calculate age by 2. Calculate age
current year deduct birth year 2.1 (current year – birth year) as age
Output : age 3. Display age

You try some exercise to get more understanding about algorithm as below:

PROBLEM ALGORITHM

1
Problem 1: 1. Scan the price and quantity of the books
To buy the books from the book shop, cashier will 2. Calculate the total price of the books
scan the price of the books and quantity of the book. 3. Display total price of the books
Then the system will calculate the total price of the
books.

Problem 2: 1. Enter weight(Kg) and height(m)


Aiman wants to know his BMI. His weight is 2. Calculate the BMI
calculated in kilogram and height is calculated in 2.1 Me
meter. Help Aiman to find his BMI. 3. Display BMI

Problem 3: 1. Scan the video rental serial number


To rent a video, customer need to scan the video 2. Video rental details will save in the system automatically
serial number at our shop scanner and the details of 3. Scanner will print the video rental details
the video will be save in the system automatically.
Next, the scanner will print out the details about the
video rental. Lastly, the customer needs to go to
counter and pay for the rental fee.

Problem 4: 1.
Every employee needs to thumb their fingerprint
everyday as proof of their daily attendance to the
work. Then the attendance system will save the
employee information such as name, time and date.
The information can be printed out at the end of the
month.

Problem 5:
Create a receipt for a list of five (5) purchased items.
Print the total price, compute the total with 8.25%
tax and print the money tendered (plus any change
given).

Problem 6:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a program that
can count the total rate by multiply room rate with
number of days, and add 10% room service charges.
Draw the flowchart by using the problem analysis
below.

Problem 7:
Mr Wong is a mathematics teacher. He wants to
teach his students about how to convert time in hour
into the times in minute. Help Mr Wong to solve his
problem.

2
Problem 8:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a program that
can count the total rate by multiply room rate with
number of days, and add 10% room service charges.
Draw the flowchart by using the problem analysis
below.

Activity 2C.2
Activity Outcome: System design (algorithm and pseudocode )
Duration : 50 minutes

After study about algorithm, Cik Suria wants you to you do some research on writing pseudo code.
PROBLEM PROBLEM ANALYSIS PROBLEM DESIGN (PSEUDO CODE)
Problem 1: Input: 3 numbers Start
Calculate total of three numbers Process : Calculate total of Enter 3 number (num1, num2, num3)
three numbers by add all 3 Calculate total of three numbers
numbers Total of three numbers = num1 +
Output : total of three num2 + num3
numbers Display total of three numbers
End
Problem 2: Input: birth year, current year Start
Calculate age Process : Calculate age by Enter birth year, current year
current year deduct birth year Calculate age
Output : age age = current year – birth year
Display age
End

You try some exercise to get more understanding about pseudo code as below:

PROBLEM PSEUDO CODE


Problem 1:
To buy the books from the book shop, cashier will
scan the price of the books and quantity of the book.
Then the system will calculate the total price of the
books.

Problem 2:
Aiman wants to know his BMI. His weight is
calculated in kilogram and height is calculated in
meter. Help Aiman to find his BMI.

3
Problem 3:
To rent a video, customer need to scan the video
serial number at our shop scanner and the details of
the video will be save in the system automatically.
Next, the scanner will print out the details about the
video rental. Lastly, the customer needs to go to
counter and pay for the rental fee.

Problem 4:
Every employee needs to thumb their fingerprint
everyday as proof of their daily attendance to the
work. Then the attendance system will save the
employee information such as name, time and date.
The information can be printed out at the end of the
month.

Problem 5:
Create a receipt for a list of five (5) purchased items.
Print the total price, compute the total with 8.25%
tax and print the money tendered (plus any change
given).

Problem 6:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a program that
can count the total rate by multiply room rate with
number of days, and add 10% room service charges.
Draw the flowchart by using the problem analysis
below.

Problem 7:
Mr Wong is a mathematics teacher. He wants to
teach his students about how to convert time in hour
into the times in minute. Help Mr Wong to solve his
problem.

Problem 8:
You have been hired by Prima Hotel as a
programmer. Your task is to develop a program that
can count the total rate by multiply room rate with
number of days, and add 10% room service charges.
Draw the flowchart by using the problem analysis
4
s
g
a
m
n
i
f
e
d
(
)
p
t
u
o
l
y
c
r
, below.

Activity 2C.3
Activity Outcome: System design (algorithm and pseudocode )
Duration : 20 minutes

Define algorithm and pseudo code for module manage staff payroll.

Case Senario:
PROBLEM

The system will automate the process of calculate payroll for employees worked at Infinity Design Solution Sdn. Bhd.
Each employee will be recognized by employee ID. The system will receive gross income, allowance, overtime, income
tax and loan deduction. The system will automatically calculate the total income, total deduction and net salary for the
employee.

ALGORITHM

5
PSEUDO CODE

You might also like