Page 5 - MODUL ALGORTIMA DAN PEMROGRAMAN
P. 5
C. Contoh Program ..................................................................................................................... 83
D. Rangkuman ............................................................................................................................. 86
E. Soal Latihan ............................................................................................................................ 86
MATERI 9 PERCABANGAN ........................................................................................................... 87
A. Percabangan IF ...................................................................................................................... 88
B. Percabangan Switch Case ....................................................................................................... 90
C. Percabangan Bersarang ......................................................................................................... 91
D. Contoh Program ..................................................................................................................... 91
E. Rangkuman ............................................................................................................................. 97
F. Soal Latihan ............................................................................................................................ 98
MATERI 10 PERULANGAN ............................................................................................................ 99
A. Perulangan For ..................................................................................................................... 100
B. Perulangan While ................................................................................................................. 100
C. Perulangan Do-While ........................................................................................................... 101
D. Perulangan Bersarang.......................................................................................................... 101
E. Contoh Program ................................................................................................................... 102
F. Rangkuman ........................................................................................................................... 106
G. Soal Latihan .......................................................................................................................... 106
MATERI 11 FUNGSI ....................................................................................................................... 107
A. Mengenal Fungsi .................................................................................................................. 108
B. Manfaat Penggunaan Fungsi ............................................................................................... 108
C. Build-in Function .................................................................................................................. 109
D. User Defined Function .......................................................................................................... 110
E. Contoh Program ................................................................................................................... 116
F. Rangkuman ........................................................................................................................... 118
G. Soal Latihan .......................................................................................................................... 118
MATERI 12 CLASS ......................................................................................................................... 120
A. Mengenal Class ..................................................................................................................... 121
B. Jenis Tingkat Akses .............................................................................................................. 122
C. Contoh Program ................................................................................................................... 122
D. Rangkuman ........................................................................................................................... 127
E. Soal Latihan .......................................................................................................................... 127
MATERI 13 ALGORITMA PENCARIAN .................................................................................... 129
A. Sequential Search .................................................................................................................. 130
B. Sequential Search dengan Sentinel ...................................................................................... 130
C. Binary Search ........................................................................................................................ 131
D. Interpolation Search .............................................................................................................. 133
v