Professional Documents
Culture Documents
Flowchart (Diagram Alur)
Flowchart (Diagram Alur)
(Diagram Alur)
1
Flowchart
Bagan-bagan yang mempunyai arus
Menggambarkan langkah-langkah
penyelesaian suatu masalah
Merupakan salah satu cara penyajian
algoritma
2
Tujuan
Menggambarkan suatu tahapan penyelesaian
masalah
Secara sederhana, terurai, rapi dan jelas
Menggunakan simbol-simbol standar
3
Four Flowchart Structures
Sequence
Decision
Repetition
Case
Sequence Structure
a series of actions are performed in
sequence
The pay-calculating example was a
sequence flowchart.
Decision Structure
One of two possible actions is taken,
depending on a condition.
Decision Structure
A new symbol, the diamond, indicates a yes/no
question. If the answer to the question is yes, the
flow follows one path. If the answer is no, the flow
follows another path
NO YES
Decision Structure
In the flowchart segment below, the question is x
< y? is asked. If the answer is no, then process A
is performed. If the answer is yes, then process B
is performed.
NO YES
x < y?
Process A Process B
Decision Structure
The flowchart segment below shows how a
decision structure is expressed in C++ as an
if/else statement.
Flowchart C++ Code
NO YES if (x < y)
x < y? a = x * 2;
else
Calculate a Calculate a a = x + y;
as x plus y. as x times 2.
Decision Structure
The flowchart segment below shows a decision
structure with only one action to perform. It is
expressed as an if statement in C++ code.
Flowchart C++ Code
NO YES if (x < y)
x < y? a = x * 2;
Calculate a
as x times 2.
Repetition Structure
A repetition structure represents part of the
program that repeats. This type of structure is
commonly known as a loop.
Repetition Structure
Notice the use of the diamond symbol. A loop
tests a condition, and if the condition exists, it
performs an action. Then it tests the condition
again. If the condition still exists, the action is
repeated. This continues until the condition no
longer exists.
Repetition Structure
In the flowchart segment, the question is x < y?
is asked. If the answer is yes, then Process A is
performed. The question is x < y? is asked
again. Process A is repeated as long as x is less
than y. When x is no longer less than y, the
repetition stops and the structure is exited.
YES
x < y? Process A
Repetition Structure
The flowchart segment below shows a repetition
structure expressed in C++ as a while loop.
while (x < y)
YES x++;
x < y? Add 1 to x
System Flowchart
Menggambarkan suatu sistem peralatan
komputer yang digunakan dalam proses
pengolahan data serta hubungan antar
peralatan tersebut
Tidak digunakan untuk menggambarkan
urutan langkah untuk memecahkan masalah
Hanya untuk menggambarkan prosedur
dalam sistem yang dibentuk
15
Keyboard
CPU Disket
VDU
16
Program Flowchart
Menggambarkan urutan logika dari suatu
prosedur pemecahan masalah
Dua jenis metode penggambaran program
flowchart :
Conceptual flowchart, menggambarkan alur
pemecahan masalah secara global
Detail flowchart, menggambarkan alur
pemecahan masalah secara rinci
17
Start
Start
Input Berapa data ; N
Jml = 0
Input
For K = 1 to N
19
Flow Direction Symbols
Simbol arus / flow
Menyatakan jalannya arus suatu proses
Simbol connector
Menyatakan sambungan dari proses ke proses
lainnya dalam halaman yang sama
22
Input / Output Symbols
Simbol input/output
Menyatakan proses input atau output
tanpa tergantung jenis peralatannya
Simbol punched card
Menyatakan input berasal dari kartu
atau output ditulis ke kartu
Simbol magnetic tape
Menyatakan input berasal dari pita
magnetis atau output disimpan ke pita
magnetis
Simbol disk storage
Menyatakan input berasal dari dari
disk atau output disimpan ke disk
23
Input / Output Symbols
Simbol document
Mencetak keluaran dalam
bentuk dokumen (melalui
printer)
Simbol display
Mencetak keluaran dalam layar
monitor
24
Contoh System Flowchart
Data jawaban
ujian
Koreksi
Daftar Koreksi
Data File Tabel
utama Siswa
ujian
Periksa Ujian
Laporan Hasil
File Ujian
siswa
lulus
25
Kaidah Pembuatan Flowchart
Start
Input
Proses
Output
End
26
Pengolahan data
START
READ
Ya
HABIS ?
Tidak
PROCESS
WRITE
END 27
Soal
Buat Diagram alur, untuk menghitung
luas persegi panjang.
Logika
Algoritm
3/12/17 28 a
Menghitung luas persegi panjang
Start
Input panjang
Input lebar
Print Luas
End
29