MODUL PRAKTIKUM - ti. Praktikum BPD... · Modul Praktikum Bahasa Pemrograman Dasar (PG168) 1...

download MODUL PRAKTIKUM - ti. Praktikum BPD... · Modul Praktikum Bahasa Pemrograman Dasar (PG168) 1 PRAKTIKUM

of 144

  • date post

    03-Mar-2019
  • Category

    Documents

  • view

    317
  • download

    14

Embed Size (px)

Transcript of MODUL PRAKTIKUM - ti. Praktikum BPD... · Modul Praktikum Bahasa Pemrograman Dasar (PG168) 1...

MODUL PRAKTIKUM

BAHASA PEMROGRAMAN DASAR

(PG168)

FAKULTAS TEKNOLOGI INFORMASI

UNIVERSITAS BUDI LUHUR

2015

Modul Praktikum Bahasa Pemrograman Dasar (PG168)

ii

DAFTAR ISI

DAFTAR ISI ................................................................................................... ii

TIM PENYUSUN ............................................................................................ vi

PRAKTIKUM 1 PENGENALAN BAHASA C ....................................................... 1

1.1 TUJUAN PRAKTIKUM ................................................................................ 1

1.2 TEORI SINGKAT ....................................................................................... 1

1.3 PELAKSANAAN PRAKTIKUM ...................................................................... 2

1.4 LATIHAN ................................................................................................. 4

1.5 TUGAS MANDIRI ...................................................................................... 5

PRAKTIKUM 2 STRUKTUR DASAR BAHASA C ............................................... 6

2.1 TUJUAN PRAKTIKUM ................................................................................ 6

2.2 TEORI SINGKAT ....................................................................................... 6

2.2.1 Tipe Data .................................................................................... 6

2.2.2 Variabel ...................................................................................... 7

2.2.3 Karakter Khusus (Special Character) ............................................. 7

2.2.4 Deklarasi ..................................................................................... 8

2.2.5 Operator ..................................................................................... 9

2.2.6 Kata Tercadang (Reserved Word) ............................................... 11

2.2.7 Komentar Program .................................................................... 11

2.3 PELAKSANAAN PRAKTIKUM .................................................................... 11

2.4 LATIHAN ............................................................................................... 16

2.5 TUGAS MANDIRI .................................................................................... 17

PRAKTIKUM 3 MASUKAN DAN KELUARAN PROGRAM ............................... 18

3.1 TUJUAN PRAKTIKUM .............................................................................. 18

3.2 TEORI SINGKAT ..................................................................................... 18

3.2.1 Perintah Masukan ...................................................................... 18

3.2.2 Perintah Keluaran ...................................................................... 19

3.3 PELAKSANAAN PRAKTIKUM .................................................................... 20

3.4 LATIHAN ............................................................................................... 23

3.5 TUGAS MANDIRI .................................................................................... 25

PRAKTIKUM 4 STRUKTUR KONDISI IF DAN IFELSE ............................... 26

Modul Praktikum Bahasa Pemrograman Dasar (PG168)

iii

4.1 TUJUAN PRAKTIKUM .............................................................................. 26

4.2 TEORI SINGKAT ..................................................................................... 26

4.2.1 Struktur Kondisi IF ..................................................................... 26

4.2.2 Struktur Kondisi IFELSE ........................................................... 27

4.3 PELAKSANAAN PRAKTIKUM .................................................................... 27

4.4 LATIHAN ............................................................................................... 32

4.5 TUGAS MANDIRI .................................................................................... 34

PRAKTIKUM 5 STRUKTUR KONDISI IF BERTINGKAT DAN SWITCHCASE

.................................................................................................................... 36

5.1 TUJUAN PRAKTIKUM .............................................................................. 36

5.2 TEORI SINGKAT ..................................................................................... 36

5.2.1 Struktur Kondisi IF Bertingkat ..................................................... 36

5.2.2 Struktur SWITCHCASE ............................................................ 37

5.3 PELAKSANAAN PRAKTIKUM .................................................................... 38

5.4 LATIHAN ............................................................................................... 43

5.5 TUGAS MANDIRI .................................................................................... 44

PRAKTIKUM 6 STRUKTUR PERULANGAN FOR............................................ 46

6.1 TUJUAN PRAKTIKUM .............................................................................. 46

6.2 TEORI SINGKAT ..................................................................................... 46

6.2.1 Struktur Perulangan FOR ........................................................... 46

6.3 PELAKSANAAN PRAKTIKUM .................................................................... 47

6.4 LATIHAN ............................................................................................... 52

6.5 TUGAS MANDIRI .................................................................................... 54

PRAKTIKUM 7 STRUKTUR PERULANGAN WHILE ....................................... 55

7.1 TUJUAN PRAKTIKUM .............................................................................. 55

7.2 TEORI SINGKAT ..................................................................................... 55

7.2.1 Struktur Perulangan WHILE ........................................................ 55

7.2.2 Struktur Perulangan DO...WHILE ................................................ 56

7.3 PELAKSANAAN PRAKTIKUM .................................................................... 57

7.4 LATIHAN ............................................................................................... 62

7.5 TUGAS MANDIRI .................................................................................... 64

PRAKTIKUM 8 UJIAN TENGAH SEMESTER ................................................. 65

8.1 SOAL-SOAL LATIHAN ............................................................................. 65

Modul Praktikum Bahasa Pemrograman Dasar (PG168)

iv

PRAKTIKUM 9 ARRAY SATU DIMENSI ........................................................ 69

9.1 TUJUAN PRAKTIKUM .............................................................................. 69

9.2 TEORI SINGKAT ..................................................................................... 69

9.3 PELAKSANAAN PRAKTIKUM .................................................................... 70

9.4 LATIHAN ............................................................................................... 76

9.5 TUGAS MANDIRI .................................................................................... 77

PRAKTIKUM 10 MANIPULASI ARRAY SATU DIMENSI ............................... 78

10.1 TUJUAN PRAKTIKUM........................................................................... 78

10.2 TEORI SINGKAT ................................................................................. 78

10.3 PELAKSANAAN PRAKTIKUM ................................................................. 78

10.4 LATIHAN ............................................................................................ 83

10.5 TUGAS MANDIRI ................................................................................ 84

PRAKTIKUM 11 PENCARIAN (SEARCHING) ............................................... 86

11.1 TUJUAN PRAKTIKUM........................................................................... 86

11.2 TEORI SINGKAT ................................................................................. 86

11.3 PELAKSANAAN PRAKTIKUM ................................................................. 86

11.4 LATIHAN ............................................................................................ 92

11.5 TUGAS MANDIRI ................................................................................ 94

PRAKTIKUM 12 PENCARIAN NILAI TERBESAR DAN TERKECIL ................. 96

12.1 TUJUAN PRAKTIKUM........................................................................... 96

12.2 TEORI SINGKAT ................................................................................. 96

12.3 PELAKSANAAN PRAKTIKUM ................................................................. 96

12.4 LATIHAN .......................................................................................... 101

12.5 TUGAS MANDIRI .............................................................................. 102

PRAKTIKUM 13 PENGGABUNGAN (MERGE) ARRAY SATU DIMENSI ...... 103

13.1 TUJUAN PRAKTIKUM........................................