Professional Documents
Culture Documents
Introduction To Problem Solving and Writing Algorithms
Introduction To Problem Solving and Writing Algorithms
INTRODUCTION TO
PROBLEM SOLVING AND
WRITING ALGORITHMS
Learning outcome
0-8
Problem Analysis Chart
0-9
Problem Analysis Chart for the Payroll
Problem
0-10
From step 1 and step 2;
Understanding the problem:
The feasibility
The limitation
Identify the following
Input – prerequisite, data that exist at the beginning of the problem
Output – the expected data/information/result from the program
Process – set of steps that need to be done in getting the output
Example 1:
Write a problem analysis for program that can input 2 integer
number from user. Find the addition for the number and
display the result. Draw the respective PAC chart.
Problem analysis
Input number1 and number2
Process result = number1 + number2
Output display result
Problem Analysis Chart
Given Data Required Result
Feet Meter
Algorithm Flowchart
1. Start Start
2. Set sum = 0
Set sum = 0
3. Read 3 integer number
4. Total up 3 integer Read a, b and c
number
sum = a + b + c Calculate sum =
5. Display sum a+b+c
End
Example 4
1. Start Start
2. Set sum = 0 Set sum =
3. Read 3 integer number 0
4. Total up 3 integer Read a, b and
number c