Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

PROGRAMMING LANGUAGE :: BAHASA PEMROGRAMAN :: USING JAVA.

Presentasi serupa


Presentasi berjudul: "PROGRAMMING LANGUAGE :: BAHASA PEMROGRAMAN :: USING JAVA."— Transcript presentasi:

1 PROGRAMMING LANGUAGE :: BAHASA PEMROGRAMAN :: USING JAVA

2 Tentang saya Nur Cahyo Wibowo, S.Kom, M.Kom Nur Cahyo Wibowo, S.Kom, M.Kom S1 Teknik Informatika ITS 1998 – 2003 S1 Teknik Informatika ITS 1998 – 2003 S2 Teknik Informatika ITS 2006 – 2009 S2 Teknik Informatika ITS 2006 – 2009 HP HP Griya Pesona Asri E-21, Medokan Ayu Griya Pesona Asri E-21, Medokan Ayu atau (YM) atau (YM) Face book : Nur Cahyo Wibowo Face book : Nur Cahyo Wibowo MK : BP, BP2, Struktur Data MK : BP, BP2, Struktur Data

3 BAHASA PEMROGRAMAN PENILAIAN: PENILAIAN: –UTS/UAS60 % –TUGAS/QUIZ30 % –KEHADIRAN10 % NILAI AKHIR = (NA UTS + NA UAS) / 2 NILAI AKHIR = (NA UTS + NA UAS) / 2

4 INTRO TO PROGRAMMING

5 PROLOG: THE COMPUTER SYSTEM HARDWARE SOFTWARE BRAINWARE PROGRAMMING O/ S GAMES APPLICATIONS

6 PROGRAMMING FRAMEWORK SOURCE CODE FILE APLIKASI MEMORI/ RAM CODING COMPILINGRUNNING OPERATING PROGRAMMER USER

7 PROGRAMMING HISTORY

8 LANGUAGE GENERATION 1 ST GENERATION – Machine Language 1 ST GENERATION – Machine LanguageASSEMBLER 2 ND GENERATION – Human Language 2 ND GENERATION – Human Language FORTRAN, C, PASCAL, BASIC 3 RD GENERATION – Visual, OOP 3 RD GENERATION – Visual, OOP DELPHI, JAVA, VISUAL BASIC 4 TH GENERATION – DBMS 4 TH GENERATION – DBMS SQL (STRUCTURED QUERY LANGUAGE)

9 ALGORITHM & FLOWCHART Tujuan : Tujuan : 1.Mahasiswa dapat menjelaskan apa itu algoritma dan flowchart. 2.Mahasiswa dapat menyebutkan beberapa simbol dasar flowchart. 3.Mahasiswa terampil dalam membuat algoritma dan flowchart untuk suatu studi kasus.

10 Lee & Lu

11 Algorithm is… A computable set of steps to achieve a desired result. Paul E. Black A computable set of steps to achieve a desired result. Paul E. Black An explicit, precise, unambiguous, mechanically- executable sequence of elementary instructions. Jeff Erickson An explicit, precise, unambiguous, mechanically- executable sequence of elementary instructions. Jeff Erickson An effective method for solving a problem using a finite sequence of instructions. Wikipedia An effective method for solving a problem using a finite sequence of instructions. Wikipedia A list of well-defined instructions for completing a task. Wikipedia A list of well-defined instructions for completing a task. Wikipedia

12 ALGORITHM Adalah urutan langkah-langkah logika yang menyatakan suatu tugas dalam menyelesaikan suatu masalah atau problem. Adalah urutan langkah-langkah logika yang menyatakan suatu tugas dalam menyelesaikan suatu masalah atau problem. Contoh: Buat algoritma untuk menentukan apakah suatu bilangan merupakan bilangan ganjil atau bilangan genap. Contoh: Buat algoritma untuk menentukan apakah suatu bilangan merupakan bilangan ganjil atau bilangan genap. Algoritmanya : 1. Bagi bilangan dengan bilangan Hitung sisa hasil bagi pada langkah Bila sisa hasil bagi sama dengan 0 maka bilangan itu adalah bilangan genap tetapi bila sisa hasil bagi sama dengan 1 maka bilangan itu adalah bilangan ganjil.

13 Some Example Buatlah algoritma untuk: 1. Membuat mi instan 2. Sarapan 3. Berangkat ke kampus 4. Menyalakan komputer 5. Mencetak file dokumen Note: definisikan terlebih dulu kondisi awal dan akhir

14 1. Buka file dokumen 2. Cek printer 3. Jika lampu menyala klik tombol printer 4. Jika lampu tidak menyala maka ulangi langkah 2.

15 What is Flowchart A diagram that uses graphic symbols to depict the nature and flow of the steps in a process. Another name for this tool is flow diagram. A diagram that uses graphic symbols to depict the nature and flow of the steps in a process. Another name for this tool is flow diagram. Maps or graphical representations of a process. Steps in a process are shown with symbolic shapes, and the flow of the process is indicated with arrows connecting the symbols. Maps or graphical representations of a process. Steps in a process are shown with symbolic shapes, and the flow of the process is indicated with arrows connecting the symbols.

16 What Flowchart for Promote process understanding by explaining the steps pictorially. People may have differing ideas about how a process works. A flowchart can help you gain agreement about the sequence of steps. Promote process understanding by explaining the steps pictorially. People may have differing ideas about how a process works. A flowchart can help you gain agreement about the sequence of steps. Flowcharts promote understanding in a way that written procedures cannot do. One good flowchart can replace pages of words. Flowcharts promote understanding in a way that written procedures cannot do. One good flowchart can replace pages of words.

17 Flowchart & Programming The flowchart is a means of visually presenting the flow of data through an information processing systems, the operations performed within the system and the sequence in which they are performed. The flowchart is a means of visually presenting the flow of data through an information processing systems, the operations performed within the system and the sequence in which they are performed. Program flowchart, which describes what operations (and in what sequence) are required to solve a given problem. Program flowchart, which describes what operations (and in what sequence) are required to solve a given problem. The program flowchart can be likened to the blueprint of a building. As we know a designer draws a blueprint before starting construction on a building. The program flowchart can be likened to the blueprint of a building. As we know a designer draws a blueprint before starting construction on a building. Similarly, a programmer prefers to draw a flowchart prior to writing a computer program. Similarly, a programmer prefers to draw a flowchart prior to writing a computer program.

18 MEANING OF A FLOWCHART Flowcharts are generally drawn in the early stages of formulating computer solutions. Flowcharts are generally drawn in the early stages of formulating computer solutions. Flowcharts facilitate communication between programmers and business people. Flowcharts facilitate communication between programmers and business people. These flowcharts play a vital role in the programming of a problem and are quite helpful in understanding the logic of complicated and lengthy problems. These flowcharts play a vital role in the programming of a problem and are quite helpful in understanding the logic of complicated and lengthy problems. Once the flowchart is drawn, it becomes easy to write the program in any high level language. Once the flowchart is drawn, it becomes easy to write the program in any high level language. Often we see how flowcharts are helpful in explaining the program to others. Often we see how flowcharts are helpful in explaining the program to others. Hence, it is correct to say that a flowchart is a must for the better documentation of a complex program. Hence, it is correct to say that a flowchart is a must for the better documentation of a complex program.

19 FLOWCHART Biasa disebut dengan diagram alir. Biasa disebut dengan diagram alir. Salah satu metode untuk merepresentasikan algoritma selain pseudocode dan urut-urutan langkah. Salah satu metode untuk merepresentasikan algoritma selain pseudocode dan urut-urutan langkah. Menggunakan simbol-simbol bangun datar beserta anak panah sebagai penunjuk arah proses. Menggunakan simbol-simbol bangun datar beserta anak panah sebagai penunjuk arah proses.

20 Some Guidelines 1. The flowchart should be clear, neat and easy to follow. There should not be any room for ambiguity. 2. The usual flow direction is from left to right or top to bottom. 3. Only one flow line should come out from a process symbol. 4. Only one flow line should enter a decision symbol, but two or three flow lines should leave the decision symbol. 5. Only one flow line is used in conjunction with terminal symbol. 6. Write within standard symbols briefly. As necessary, you can use the annotation symbol to describe more clearly. 7. If the flowchart becomes complex, it is better to use connector symbols to reduce the number of flow lines. Avoid the intersection of flow lines. 8. Ensure that the flowchart has a logical start and finish. 9. It is useful to test the validity of the flowchart by passing through it with a simple test data.

21 SIMBOLNAMAFUNGSI TERMINATOR Permulaan/ akhir program GARIS ALIR (FLOW LINE) Arah aliran program PREPARATION Proses inisialisasi/ pemberian harga awal PROSES Proses perhitungan/ proses pengolahan data

22 INPUT/ OUTPUT DATA Proses input/ output data, parameter, informasi PREDEFINED PROCESS (SUB PROGRAM) Permulaan sub program/ proses menjalankan sub program DECISION Perbandingan pernyataan, penyeleksian data yang memberikan pilihan untuk langkah selanjutnya ON PAGE CONNECTOR Penghubung bagian-bagian flowchart yang berada pada satu halaman OFF PAGE CONNECTOR Penghubung bagian-bagian flowchart yang berada pada halaman berbeda

23 Contoh: Flowchart untuk menentukan bilangan genap atau ganjil Y T Start Input Bilangan Hitung sisa bagi antara bilangan dengan angka 2 A A Apakah Sisa = 0 Cetak Genap Cetak Ganjil End

24 AKAR PERS. KUADRAT 1. Mulai 2. Masukkan nilai variabel A, B, C 3. Hitung D =B 2 – 4*A*C 3. Hitung D = B 2 – 4*A*C 4. Jika D = 0 maka X 1 = X 2 = – B/(2*A) Tapi jika D < 0 maka X 1, X 2 Imaginer selain itu maka X 1,2 = ( – B ± √D)/(2*A) 5. TampilkanX 1, X 2 5. Tampilkan X 1, X 2 6. Selesai

25 FLOWCHART AKAR PERSAMAAN KUADRAT Start Input Nilai A, B, C D = 0 ? Cetak X1, X2 End X = (– B ± √D)/(2*A) D = B 2 – 4*A*C X1 = X2 = – B/(2*A) Y T D < 0 ? X1, X2 Imaginer Y T DIKET: Y = AX 2 + BX + C

26 Bilangan Faktorial 1. Mulai 2. Masukkan N (N adalah bilangan yang akan dihitung nilai faktorialnya) 3. Set variabel Faktorial  1 4. Set variabel Angka  1 5. Hitung Faktorial  Faktorial * Angka 6. Angka  Angka Apakah Angka > N ? Jika TIDAK kembali ke langkah (5). Jika YA tampilkan nilai Faktorial. 8. Selesai

27 FLOWCHART FAKTORIAL Y T Start Input N Faktorial = Faktorial * Angka A A Angka > N ? Cetak Faktorial End Faktorial  1 Angka  1 Angka = Angka + 1 EX. 4! = 4 x 3 x 2 x 1 = 24

28 LATIHAN SOAL 1. Buatlah flowchart untuk memasak mi instan! 2. Buatlah flowchart untuk naik angkot/ lyn! 3. Buat algoritma untuk menghitung jumlah N suku dari deret aritmatika dengan pola berikut : Sn = …… + (4n-1) 4. Buat flowchart untuk mencetak pasangan nilai X dan Y dimana hubungan antara X dan Y memenuhi persamaan Y = X3 – 2X +1 dan nilai x berubah dari –10 sampai 10 ! 5. Buat algoritma + flowchart untuk menentukan apakah suatu bilangan merupakan bilangan prima atau bukan! 6. Buat algoritma + flowchart untuk mencetak N buah bilangan prima yang pertama!


Download ppt "PROGRAMMING LANGUAGE :: BAHASA PEMROGRAMAN :: USING JAVA."

Presentasi serupa


Iklan oleh Google