Beruflich Dokumente
Kultur Dokumente
Kuliah #1
By
Dr. Amil Ahmad Ilham, S.T., M.IT.
http://www.unhas.ac.id/amil
Materi Kuliah
Slides dapat di download di:
http://www.unhas.ac.id/amil/mk/S1TE/2014_2/AS/
Rules!
Please be aware that:
No mark (zero) for late assignments without prior
permission or urgent reasons.
No mark (zero) for cheated assignments or exams.
No talks via mobile phone during class.
Silent mode is OK
You can leave class if you have an urgent call.
Penilaian
Mid/Final Test (wajib diikuti)
Total Nilai = 0, jika Mid/Final Test tidak diikuti.
Perbaikan Nilai
Tidak ada (waktu) perbaikan nilai.
Ujian susulan hanya akan diberikan jika
berhalangan hadir pada saat ujian karena:
Sakit atau alasan pribadi lain yang dapat diterima.
Ada pemberitahuan pada saat ujian atau sebelum
ujian
Contact info
HP: 0853-9883-1853 (SMS and URGENT CALL
ONLY)
amil_ai@yahoo.com
Introduction
What is a computer
Computer
is a device that receives input,
stores and processes data, and
provides output in a useful format.
10
What is an Algorithm?
The plan for writing a program.
The sequence of steps that describe solution of
problem.
Algorithms are written according to rules so that
other programmers are also able to read and
understand the solution easily.
11
Flowcharts
Flowcharts are graphical tools, containing a set of
shapes, each expressing a different action in a
sequence of program execution.
A Flowchart
shows logic of an algorithm
emphasizes individual steps and their
interconnections
e.g. control flow from one action to the next
12
Pseudocode
Pseudocode is an artificial and informal
language that helps programmers develop
algorithms. Pseudocode is very similar to
everyday English (Indonesian)
Biasanya dibuat sebelum menulis algoritma atau
menggambar flowchart.
13
Start or stop
Process
Input
Flowchart
Symbols
Decision
Flow line
Connector
Output
Off-page connector
14
Sequences
A sequence of instructions that are executed in
the precise order they are written in:
statement block 1
statement block 1
statement block 2
statement block 3
statement block 2
statement block 3
15
Conditionals
Select between alternate courses of action
depending upon the evaluation of a condition
If ( condition = true ) then
statement block 1
else
statement block 2
end if
True
False
condition
statement
block 1
statement
block 2
16
Loops
Loop through a set of statements as long as a
condition is true
Loop while ( condition = true )
statement block
end Loop
statement
block
True
condition
False
17
Contoh#1
Tuliskan Pseudecode
dan algoritma serta
gambarkan
flowchartnya untuk
menghitung konversi
derajat Fahrenheit ke
Celcius.
Pseudocode:
Input derajat Fahrenheit
Hitung derajat Celcius
Print derajat Celcius
18
Contoh#1
Pseudocode:
Input derajat
Fahrenheit
Hitung derajat Celcius
Print derajat Celcius
Algoritma
(Deskripsi/rincian langkah)
Input F
C (F - 32.0) * 5.0 /9.0
Print C
19
Contoh#1
Flowchart
Algoritma
(Deskripsi/rincian
langkah)
Input F
C (F - 32.0) * 5.0 /9.0
Print C
START
Input F
Print C
STOP
20
Contoh#2
Tuliskan Pseudecode
dan algoritma serta
gambarkan
flowchartnya untuk
menentukan nilai
tertinggi dari dua nilai
yang diinput dan
kemudian mencetak
nilai tertinggi tersebut.
Pseudocode:
Input nilai A dan B
Tentukan nilai tertinggi
dengan
membandingkan nilai A
dan B
Print nilai tertinggi
21
Contoh#2
Pseudocode:
Input nilai A dan B
Tentukan nilai tertinggi
dengan
membandingkan nilai A
dan B
Print nilai tertinggi
Algoritma
(Deskripsi/rincian langkah)
Input A,B
if (A > B ) then
NT A
else
NT B
endif
Print NT
22
Contoh#2
START
Algoritma
(Deskripsi/rincian
langkah)
Input A,B
Input A,B
if (A > B then )
NT A
else
NT B
endif
Print NT
Flowchart
Apakah
A>B
?
NT A
NT B
Print
Nilai Tertinggi adalah, NT
STOP
23