M5 - Pattern Recognition
M5 - Pattern Recognition
Logic Algorithm
Prasetyo Wibowo
Politeknik Elektronika Negeri Surabaya
Departement of Informatic and Computer Engineering,
Before We Start
Is this sandwiches?
Politeknik Elektronika Negeri Surabaya 20
Logic Algorithm
Pattern Recognition in Logic Algorithm
Politeknik Elektronika Negeri Surabaya
Departement of Informatic and Computer Engineering,
Let’s Throwback to Pseudocode Functionality
Repetition
Repeating a series of
statements
Example: Input and print 10
integer number sequentially
1. SET count to 1
2. WHILE ( count < 10)
3. WRITE "Enter an integer
number"
4. READ aNumber
5. WRITE "You entered " +
aNumber
6. count ← count + 1
Politeknik Elektronika Negeri Surabaya 22
Logic Algorithm
Three Construct
While For
Politeknik Elektronika Negeri Surabaya 24
Logic Algorithm
Let’s Try
Create a program that display all
number input
1. INPUT a and n
2. SET i to 0
3. WHILE i < n
DISPLAY number from array
SET i = i + 1
4. END