Materi logika dan pemrograman untuk microteaching di Amikom. beberapa referensi diambil dari http://www.slideshare.net/BaabtraMentoringPartner/algorithms-introduction-to-computer-programming
2. ● Android Developer di qiscus
● Penulis buku “Livecoding! 9 Aplikasi Android
Buatan Sendiri”
● omayib@gmail.com (email) | @omayib
(Twitter)
“jika pelukis memilki kanvas untuk mencurahkan imajinasinya,
Maka programmer punya RAM yang bisa di manipulasi sesuai
imajinasi”
Arif Akbarul Huda
5. What is programming?
● Series of instruction to a computer to accomplish a
task
● Group of instruction will make a program to perform
that particular task
6. How to give instruction to Computer
Abcdefghaij
blblblabla01100110001
8. What is Algorithms?
● List of step
● Like the instruction for a recipe
● Used for solving specific task or problem
9. Sample task
Task : add two number
Algorithm :
Step 1: Start
Step 2: Declare variables num1, num2 and sum.
Step 3: Read values num1 and num2.
Step 4: Add num1 and num2 and assign the result to sum.
sum←num1+num2
Step 5: Display sum
Step 6: Stop
10. What is flowchart looks like?
start
Get two number
Calculate both number
Show the result
finish
12. Wich is the oldest?
Nabila
17 old
Vina
12 old
Feyza
15 old
13. Wich is the oldest?
Step 1: Start
Step 2: Declare variables a,b and c.
Step 3: Read variables a,b and c.
Step 4: If a>b
If a>c
Display a is the largest number.
Else
Display c is the largest number.
Else
If b>c
Display b is the largest number.
Else
Display c is the greatest number.
Step 5: Stop
14. What is the flowchart look like?
start
Get input as a, b, c
a>b
C as the oldestb>c
a>c A as the oldesty y
n
n
B as the oldest
y
n
finish
15. How does human perform simple
task?
Add 345 and 155
500!
16. 1. She hear it trough input sense
2. Store the number 345 and 155 in his
memory
3. Calculate those number in his brain and
store the result in memory
4. She say the result trough output sense
17. How does computer perform simple
task?
1. Computer use keyboard to receive input
4. Computer user monitor to display
output
3. Camputer calculate both number
using CPU (with ALU inside) and
store back in RAM
2. Computer store the number 345
and 155 in RAM
20. ● During programming, we my need to do
following
– Store data temporarily
– Control the normal flow of instruction
– Repeat one or more instruction several time
– Repeat group of instruction at several parts of
program
http://www.slideshare.net/BaabtraMentoringPartner/algorithms-introduction-to-computer-programming on slide 48
21. ● During programming, we my need to do
following
– Store data temporarily (variable)
– Control the normal flow of instruction (Decission)
– Repeat one or more instruction several time
(Loops)
– Repeat group of instruction at several parts of
program (Function)
http://www.slideshare.net/BaabtraMentoringPartner/algorithms-introduction-to-computer-programming on slide 48
24. ● Place to put data or value
● Presented by letter or a word
● Variable name can't contain space
● Some of data types are String, Int, Boolean, Float
● Example (java)
● int TOTAL_NUM = 10;
● String city=””;
27. ● A program often needs to decide wheter something is true or
false in order to see which way to continue
● Also called conditional statement
● if...else
● Switch...case
30. ● a loop is a sequence of instruction s that is continually repeated
until a certain condition is reached
● A loop often has a counter and continues to repeat a specified
number of times
● Some type of loop in programming
● For..
● While
● do...while
33. ● In most programming language, small sub-programs are
used to perform some of the task
● Functions usually "take in" data, process it, and "return" a result
● Once a function is written, it can be used over and over and
over again
● Functions can be "called" from the inside of other functions.