Escolar Documentos
Profissional Documentos
Cultura Documentos
1
Problem Solving and
Chap 2
Algorithm
3
Problem Solving and
Chap 2
Algorithm
4
Problem Solving and
Chap 2
Algorithm
Procedure or formula
for solving problem
Sequence set of
steps taken to solve
a problem
Instructions for actions to be executed by computer
(input/process/output)
5
Problem Solving and
Chap 2
Algorithm
6
Problem Solving and
Chap 2
Algorithm
7
Problem Solving and
Chap 2
Algorithm
Keywor
d?
print
if student's grade is greater than or equal to 60 means
print the statement "passed" display on
else the screen
print the statement "failed" monitor
Keywor
d?
set
Set total to zero means
Set grade counter to one assign the
While grade counter is less than or equal to ten value,e.g:
Input the next grade
Add the grade into the total total = 0
Set the class average to the total divided by ten
Print the class average.
while is used
whenever the
process is to 9
be continued
Problem Solving and
Chap 2
Algorithm
11
Problem Solving and
Chap 2
Algorithm
(Using example from chapter 1)
Write a
Given the value of x is 10 and a is 12, program!
find the result of the following equation:
y = 2x + a - 6 Keywor
d
start
read the value of x
read the value of a
compute the value of y as y = 2x + a -6
display/print the result (or the value of y) 12
end
Problem Solving and
Chap 2
Algorithm
(Using example from chapter 1)
Uncle Degawan wants to buy 5 tins of paint from
Cindas shop. The price of each tin of the paint is
RM 15.60. Calculate the price which Uncle Degawan
have to pay for all the tin of paints he bought.
Write a
program!
start
read the amount of paint
compute the total price as price per tin times by amount of
paint
display/print the result (or the total price) Keywor
end d?13
Problem Solving and
Chap 2
Algorithm
Write a program!
14
Problem Solving and
Chap 2
Algorithm
Keywor
d
start
read the student mark
if mark is greater than 85 and mark is less than 100, then
set grade as A
display/print the grade
end
Keywor
d
15
Problem Solving and
Chap 2
Algorithm
Schematic representation of an
algorithm or process
16
Problem Solving and
Chap 2
Algorithm
Start/Stop
The terminator symbol marks the
starting or ending point of the
system. It usually contains the
word "Start" or "End."
Action or Process
A box can represent a single step
("add two cups of flour"), or and
entire sub-process ("make
bread") within a larger process.
17
Problem Solving and
Chap 2
Algorithm
Decision
A decision or branching point. Lines
representing different decisions
emerge from different points of the
diamond.
Input/Output
Represents material or information
entering or leaving the system,
such as customer order (input) or a
product (output).
18
Problem Solving and
Chap 2
Algorithm
Flow Line
Lines indicate the sequence of
steps and the direction of flow.
Connector
Indicates that the flow continues
where a matching symbol
(containing the same letter) has
been placed.
19
Problem Solving and
Chap 2
Algorithm
Off Page
Indicates that the process continues off
page.
Database
Indicates a list of information with a
standard structure that allows for
searching and sorting.
20
Problem Solving and
Chap 2
Algorithm
21
Problem Solving and
Chap 2
Algorithm
22
Problem Solving and
Chap 2
Algorithm
y = 2x + a - 6
Print y
23
End