Professional Documents
Culture Documents
Topic 5 SEQUENCE ALGORITHM
Topic 5 SEQUENCE ALGORITHM
ELEMENT OF ALGORITHM
VARIABLES
Math:
A letter that can represent any
number
Programming:
A letter/word that serve as a
temporary storage that can
represent any value
ELEMENT OF ALGORITHM
VARIABLES
RULES IN CREATING VARIABLES
• Do not use special characters ( *,/,\,
#)
• Don’t start in numbers (Ex. 1A, 2B, 3C)
• Start with letters
ELEMENT OF ALGORITHM
SYMBOLS
’+’ for Addition
’-’ for Subtraction
’*’ for Multiplication
’/’ for Division
’=’ Assignment operator
, Separator
; End of statement
TYPES OF ALGORITHM
SEQUENCE REPETITION
1 2 3
SELECTION
PROCESS
• Input
• Process
• Output
SEQUENCE REPETITION
1 2 3
SELECTION
WE CAN CREATE MANY
POSSIBLE ANSWER
Solution B
Solution A Solution C
HOW TO WRITE
SEQUENCE
ALGORITHM
NEED TO REMEMBER
Writing algorithm does not have any well defined-
standards
PROBLEM #3
3. There are 45 carpenters in a crew. On a certain
day, 9 were present. What percent showed up for work?