PSPD Lab 2D PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

ACTIVITY 2D: Problem Solving Methods

Duration: 2 Hours

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

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


1. Identify the various types of algorithm (Flow chart).
2. Develop flowchart using problem solving tools (Raptor).

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 (flow chart)

Activity 2D.1
Activity Outcome: System design (flow chart )
Duration : 30 minutes

Cik Suria propose the algorithm and pseudo En. Muhammed. En. Muhammed wants to
convert the algorithm or pseudo code into flow chart. Cik Suria ask you to proceed with
system design and try to convert algorithm and pseudo code into flow chart. You do some
research on flow chart as examples below:

PROBLEM DESIGN
PROBLEM PROBLEM DESIGN (FLOW CHART)
(ALGORITHM)
Problem 1: 1. Enter 3 numbers
Calculate total 2. Calculate total of three Start
of three numbers
numbers 3. Display total of three
numbers num1, num2, num3

total = num1 + num2 + num3

display total

End
Problem 2: 1. Enter birth year, current
Calculate age year
Start
2. Calculate age
2.1 (current year – birth
year) as age birth year, current year
3. Display age

age = current year – birth year

display age

End

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

PROBLEM FLOW CHART


Problem 1:
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 2:
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 3:
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 4:
Aiman wants to know his BMI. His weight is
calculated in kilogram and height is
calculated in meter. Help Aiman to find
his BMI.

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 by construct a flowchart.
Activity 2D.2
Activity Outcome: System design (algorithm, pseudo code and flow chart )
Duration : 30 minutes

After study about algorithm, Cik Suria wants you to you do some exercise on converting
between algorithm, pseudo code and flow chart.

ALGORITHM FLOW CHART

1) Input gross_income, cost, allowance,


overtime
2) Calculate net income using formula:
net_income = (gross_income –
cost) + allowance + overtime
3) Display net_income

1) Input meter
2) Convert meter to kilometer
2.1) kilometer = meter * 1000
3) Display kilometer

FLOW CHART PSEUDO CODE


START
Set Total = 0, Average = 0;
Input quiz1, quiz2, quiz3;
Calculate Total
Total = quiz1 + quiz2 + quiz3;
Calculate Average
Average = Total / 3;
Display Average;
END

Start
Set Total_sale=0,Discount=0.25
Input Item_price
START Calculate Discount_price
Discount_price=Item_price*Discount
Calculate New_price
New_price=Item_price-Discount_price
Set total sale = 0
Display New_price
End
Input
item_price

discount_price = item_price * 25%

new_price =item_price – discount_price

Print discount_price and


new_price

END
• manage staff payroll
Case Scenario • (define input, process, output)

Activity 2D.3
Activity Outcome: System design (flow chart )
Duration : 15 minutes

Draw flow chart for module manage staff payroll.

PROBLEM

Case Senario:
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.

FLOW CHART
Activity 2D.4
Activity Outcome: Develop flowchart using problem solving tools (Raptor).
Duration : 45 minutes

Cik Suria just realizes that instead of using Microsoft Word to develop flow chart, you can use
Raptor tools to develop flow chart more easily. You do some research on Raptor tools and try
to develop all flow chart in Lab 2D.1, 2D.2 and 2D.3 by using Raptor tools.

You might also like