Presentasi sedang didownload. Silahkan tunggu

Presentasi sedang didownload. Silahkan tunggu

CSE1301 Computer Programming Lecture 3: Components of an Algorithm

Presentasi serupa


Presentasi berjudul: "CSE1301 Computer Programming Lecture 3: Components of an Algorithm"— Transcript presentasi:

1 CSE1301 Computer Programming Lecture 3: Components of an Algorithm
CSE1301 Sem 5/28/2018 CSE1301 Computer Programming Lecture 3: Components of an Algorithm Pengenalan Algoritma Lecture 3: Components of Algorithms

2 Bagaimana kita memecahkan masalah?
CSE1301 Sem 5/28/2018 Bagaimana kita memecahkan masalah? Langsung dipecahkan Menebak nebak Mencoba-coba (Trial-and-error) Pengalaman (bisa saja dari pengalaman orang lain) Secara ilmiah Lecture 3: Components of Algorithms

3 Proses Pemecahan Masalah
CSE1301 Sem 5/28/2018 Proses Pemecahan Masalah "Doctor, my head hurts" Patient has elevated pressure in anterior parietal lobe Analisis Spesifikasi Masalah 1. Sterilize cranial saw 2. Anaesthetize patient 3. Remove top of skull 4. Get the big spoon... 5. etc., etc. Desain Algoritma Implementasi sterilize(saw,alcohol); raise_hammer(); lower hammer(fast); start(saw); /* etc. etc. */ Program Compilasi Executable (solusi) Lecture 3: Components of Algorithms

4 Proses Pemecahan Masalah
CSE1301 Sem 5/28/2018 Proses Pemecahan Masalah "Dokter, kepala saya sakit" Pasien mendapatkan benturan keras pada wajah. Analisis Spesifikasi masalah 1. Sterilkan gergaji tengkorak 2. Bius pasien 3. Ambil bagian atas tengkorak 4. Ambil Sendok besar... 5. dst.,dst. Desain Algoritma Implementasi sterilize(saw,alcohol); raise_hammer(); lower hammer(fast); start(saw); /* dst. dst. */ Program Compilasi Executable (solusi) Lecture 3: Components of Algorithms

5 Proses Pemecahan Masalah
CSE1301 Sem 5/28/2018 Proses Pemecahan Masalah Analisis Spesifikasi Masalah Desain Algoritma Implementasi Program Compilasi Executable (solusi) Lecture 3: Components of Algorithms

6 CSE1301 Sem 5/28/2018 Algoritma Barisan instruksi yang menentukan langkah-langkah untuk menyelesaikan suatu tugas. Berasal dari nama akhir: Muhammad ibn Musa al-Khwarizmi dari Khowarezm (sekarang Khiva di Uzbekistan) M. Lecture 3: Components of Algorithms

7 Sejarah Algoritma Muhammad ibn Musa Al-Khwarizmi Buku aritmatika:
CSE1301 Sem 5/28/2018 Sejarah Algoritma Muhammad ibn Musa Al-Khwarizmi Buku aritmatika: Hindu numeration, decimal numbers, use of zero, method for finding square root Latin translation (c.1120 CE): “Algoritmi de numero Indorum” Buku Aljabar Hisab al-jabr w’al-muqabala Lecture 3: Components of Algorithms

8 Contoh Algoritma Resep memasak
CSE1301 Sem 5/28/2018 Contoh Algoritma Resep memasak Aturan bagaimana memainkan sebuah permainan Petunjuk mengemudi dari lokasi A ke B Pola rajutan Manual memperbaiki mobil Lecture 3: Components of Algorithms

9 CSE1301 Sem 5/28/2018 Apel Berselimut Campurkan tepung terigu, margarine, gula halus dan kuning telur dengan sendok kayu, diaduk. Simpan di lemari es Adonan digilas tipis kira-kira ½ cm, bentuk persegi panjang, kemudian potong dengan ukuran 15x15 cm Apel dikupas dan dipotong ½ lingkaran dengan tebal 1 cm direbus dalam air gula, kayu manis, dan air hingga kering. Taruh satu potong apel taruh pada potongan adonan kulit, lipat setiap sudut ke tengah sehingga apel tertutup. Atasnya dihiasi dengan adonan kulit berbentuk bunga kecil. Olesi kulit kue dengan capuran kuning telur dengan rum Panggang dalm oven yang telah dipanaskan selama 30 menit. Hidangkan setelah dingin Bahan: 300 gr tepung terigu 250 gr margarine 75 gr gula halus 1 ½ butir telur 2 buah apel 1 sdt kayu manis 3 sdm air 1 butir kuning telur 1 sdm rum Lecture 3: Components of Algorithms

10 CSE1301 Sem 5/28/2018 Apel Berselimut Campurkan tepung terigu, margarine, gula halus dan kuning telur dengan sendok kayu, diaduk. Simpan di lemari es Adonan digilas tipis kira-kira ½ cm, bentuk persegi panjang, kemudian potong dengan ukuran 15x15 cm Apel dikupas dan dipotong ½ lingkaran dengan tebal 1 cm direbus dalam air gula, kayu manis, dan air hingga kering. Taruh satu potong apel taruh pada potongan adonan kulit, lipat setiap sudut ke tengah sehingga apel tertutup. Atasnya dihiasi dengan adonan kulit berbentuk bunga kecil. Olesi kulit kue dengan capuran kuning telur dengan rum Panggang dalm oven yang telah dipanaskan selama 30 menit. Hidangkan setelah dingin Bahan: 300 gr tepung terigu 250 gr margarine 75 gr gula halus 1 ½ butir telur 2 buah apel 1 sdt kayu manis 3 sdm air 1 butir kuning telur 1 sdm rum Instruksi diberikan dalam bentuk urut-urutan yang harus dikerjakan (“dieksekusi”) Lecture 3: Components of Algorithms

11 CSE1301 Sem Correct Algorithm? 5/28/2018 Cut chicken into pieces and brown the pieces on all sides in a casserole dish in hot olive oil. Remove the chicken and to the juices in the casserole add garlic, onions and green peppers, and sauté until onion is golden. Add bay leaf, whole tomatoes, and chicken broth. When the broth boils add salt, saffron and rice. Arrange chicken on rice, cover casserole and bake in a moderate oven (350°F) for 20 minutes or until the rice is tender. Add beans and artichokes during last 10 minutes of cooking. From: “Arroz Con Pollo” in The Margaret Fulton Cookbook, Hamlyn, Sydney, 1968. Lecture 3: Components of Algorithms

12 CSE1301 Sem Correct Algorithm? 5/28/2018 Cut chicken into pieces and brown the pieces on all sides in a casserole dish in hot olive oil. Remove the chicken and to the juices in the casserole add garlic, onions and green peppers, and sauté until onion is golden. Add bay leaf, whole tomatoes, and chicken broth. When the broth boils add salt, saffron and rice. Arrange chicken on rice, cover casserole and bake in a moderate oven (350°F) for 20 minutes or until the rice is tender. Add beans and artichokes during last 10 minutes of cooking. From: “Arroz Con Pollo” in The Margaret Fulton Cookbook, Hamlyn, Sydney, 1968. Lecture 3: Components of Algorithms

13 CSE1301 Sem Correct Algorithm? 5/28/2018 Cut chicken into pieces and brown the pieces on all sides in a casserole dish in hot olive oil. Remove the chicken and to the juices in the casserole add garlic, onions and green peppers, and sauté until onion is golden. Add bay leaf, whole tomatoes, and chicken broth. When the broth boils add salt, saffron and rice. Arrange chicken on rice, cover casserole and bake in a moderate oven (350°F) for 10 minutes. Add beans and artichokes. Cover, and bake for another 10 minutes or until rice is tender. Lecture 3: Components of Algorithms


Download ppt "CSE1301 Computer Programming Lecture 3: Components of an Algorithm"

Presentasi serupa


Iklan oleh Google