Dasar-Dasar Pemrograman

Slides:



Advertisements
Presentasi serupa
Design and Analysis of Algorithm Recursive Algorithm Analysis
Advertisements

1 Algoritma Bahasa Pemrograman dan Bab 1.1. Pengertian Algoritma.
Algoritma dan Struktur Data
Function.
Pemrograman Berorientasi Objek Bab 1 – Pemrograman Terstruktur.
2. Introduction to Algorithm and Programming
STRUCTURAL CONTROL STATEMENT  If  If…..else….  If ….elseif…else.
SUBPROGRAM IN PASCAL PROCEDURE Lecture 5 CS1023.
K-Map Using different rules and properties in Boolean algebra can simplify Boolean equations May involve many of rules / properties during simplification.
TEKNIK PENGINTEGRALAN
1 DATA STRUCTURE “ STACK” SHINTA P STMIK MDP APRIL 2011.
WaterfallPrototyping RAD Incremental Prototyping Pendekatan SDLC.
BLACK BOX TESTING.
Presented By : Group 2. A solution of an equation in two variables of the form. Ax + By = C and Ax + By + C = 0 A and B are not both zero, is an ordered.
1 Diselesaikan Oleh KOMPUTER Langkah-langkah harus tersusun secara LOGIS dan Efisien agar dapat menyelesaikan tugas dengan benar dan efisien. ALGORITMA.
Menulis Kolom  Kolom adalah opini atau artikel. Tidak seperti editorial, kolom memiliki byline.  Kolom Biasanya ditulis reguler. Biasanya mingguan atau.
1 Pertemuan 09 Kebutuhan Sistem Matakuliah: T0234 / Sistem Informasi Geografis Tahun: 2005 Versi: 01/revisi 1.
1 Pertemuan 4 Types of Questions Matakuliah: G0942/Listening 1 Tahun: 2005 Versi: baru.
1 Pertemuan 12 Pengkodean & Implementasi Matakuliah: T0234 / Sistem Informasi Geografis Tahun: 2005 Versi: 01/revisi 1.
Algoritma dan Struktur Data Marsel W. Aipassa, S.Kom.
Masalah Transportasi II (Transportation Problem II)
Dasar-Dasar Pemrograman
MICHAEL LIE HADIWIDJOJO 6B Children’s Rights. Education Issue There are some children in Indonesia don’t get education. They have to earn money for helping.
Chapter 13 (last) Recursion (Rekursi) Program S1-Ekstensi Departemen Teknik Elektro FTUI Slides ©2007.
PERTEMUAN KE-6 UNIFIED MODELLING LANGUAGE (UML) (Part 2)
HAMPIRAN NUMERIK SOLUSI PERSAMAAN NIRLANJAR Pertemuan 3
Verb Tense Tense denotes the time of the action indicated by a verb. The time is not always the same as that indicated by the name of the tense.
Mata kuliah :K0362/ Matematika Diskrit Tahun :2008
9.3 Geometric Sequences and Series. Objective To find specified terms and the common ratio in a geometric sequence. To find the partial sum of a geometric.
OPERATOR DAN FUNGSI MATEMATIK. Operator  Assignment operator Assignment operator (operator pengerjaan) menggunakan simbol titik dua diikuti oleh tanda.
Jartel, Sukiswo Sukiswo
While … do … Repeat … until … For … to … do …
SITI ROHMAH LULU MUTHOHAROH CLASS B
07/11/2017 BARISAN DAN DERET KONSEP BARISAN DAN DERET 1.
Konsep pemrograman LOOP
Materi 10 LOGIKA & ALGORITMA.
CA113 Pengantar Manajemen Bisnis
Parabola Parabola.
REKURSI Struktur data.
Algorithms and Programming Searching
REAL NUMBERS EKSPONENT NUMBERS.
FUNGSI.
CA113 Pengantar Manajemen Bisnis
Rekursif- studi kasus.
Recursive function.
Pemrograman VB.NET Pertemuan 4 Sorang Pakpahan,S.Kom.,M.Kom.
Teknik Pengujian Software
Pertemuan #1 The Sentence
Master data Management
Algoritma Rekursif Alpro-2.
Rekursif By Serdiwansyah N. A..
An assessment of Pedestrian Ways in Unsyiah
Welcome 8clicks Pte Ltd. About us  8CLICKS PTE LTD is best web Development Company in Singapore. It is famous for their web designing services. 8CLICKS.
How Can I Be A Driver of The Month as I Am Working for Uber?
How the Challenges Make You A Perfect Event Organiser.
Things You Need to Know Before Running on the Beach.
Don’t Forget to Avail the Timely Offers with Uber
Takes Rides for Never Ending Fun pacehire.co.uk. It’s still Time to Make Fun Before the Holidays pacehire.co.uk.
CA113 Pengantar Manajemen Bisnis
Dasar-Dasar Pemrograman
Group 3 About causal Conjunction Member : 1. Ahmad Fandia R. S.(01) 2. Hesti Rahayu(13) 3. Intan Nuraini(16) 4. Putri Nur J. (27) Class: XI Science 5.
Algoritma & Pemrograman 1 Achmad Fitro The Power of PowerPoint – thepopp.com Chapter 3.
Algoritma & Pemrograman 1 Achmad Fitro The Power of PowerPoint – thepopp.com Chapter 4.
Lesson 2-1 Conditional Statements 1 Lesson 2-1 Conditional Statements.
INTERROGATIVE ADJECTIVE. DEFINITION FUNCTION EXAMPLE QUESTION.
Perulangan (Loop) Oleh : Tim Teaching
Right, indonesia is a wonderful country who rich in power energy not only in term of number but also diversity. Energy needs in indonesia are increasingly.
Draw a picture that shows where the knife, fork, spoon, and napkin are placed in a table setting.
Wednesday/ September,  There are lots of problems with trade ◦ There may be some ways that some governments can make things better by intervening.
Transcript presentasi:

Dasar-Dasar Pemrograman Nested Loop & Rekursif Marsel Willem Aipassa, S. Kom. Dasar-Dasar Pemrograman

Nested Loop Logical structure used in computer programming where two repeating statements are placed in a "nested" form. In a nested loop, the first iteration of the outer loop causes the inner loop to execute. The inner loop then repeats for as many times as is specified. When the inner loop completes, the outer loop is executed for its second iteration, triggering the inner loop again, and so on until the requirements for the outer loop are complete. Marsel Willem Aipassa, S. Kom.

Example (Multiply Table) N\M 1 2 3 4 5 6 7 8 10 12 14 16 9 13 15 18 21 24 20 28 32 25 30 35 40 36 42 48 for loop1 := 1 to 6 do begin for loop2 := 1 to 8 do begin write(loop1*loop2,' '); end; writeln(); Marsel Willem Aipassa, S. Kom.

Latihan Membuat aplikasi yang akan memberikan output seperti berikut: 1 2 3 4 5 … n ……… n kali Marsel Willem Aipassa, S. Kom.

Tugas Kelas 1 2 3 4 5 … n ……… n kali Buatlah program yang dapat memberikan output berikut berdasarkan inputan n. 1 2 3 4 5 … n ……… n kali Marsel Willem Aipassa, S. Kom.

Recursion function a(nilai : integer) begin a(3); end; Method of defining functions in which the function being defined is applied within its own definition. Recursive are typically slower than iterative functions. Recursive must have a condition to stop. Not every programming language allows recursion, because it can cause lack of memory. function a(nilai : integer) begin a(3); end; Marsel Willem Aipassa, S. Kom.

Contoh (Penambahan bilangan) Membuat aplikasi untuk menghitung dengan aturan: f(n) = f(n)+f(n-1)+f(n-2)+f(n-3) +f(n-4) Contoh: f(5) = 5+4+3+2 +1 = 15 Marsel Willem Aipassa, S. Kom.

When should we use iteration, and when use recursion? There are (at least) these three factors to consider: Iterative functions are typically faster than their recursive counterparts. So, if speed is an issue, you would normally use iteration. If the stack limit is too constraining then you will prefer iteration over recursion. Some procedures are very naturally programmed recursively, and all but unmanageable iteratively. Marsel Willem Aipassa, S. Kom.

Tugas Buatlah aplikasi untuk menghitung nilai faktorial dari suatu bilangan. Dalam perhitungan tidak diperbolehkan menggunakan operator perkalian, hanya dengan operator penambahan dengan menggunakan Nested Looping! Contoh : input = 4 output = 24 (faktorial dari 4) Buatlah aplikasi untuk menampilkan deret fibonaci. Tidak diperbolehkan menggunakan rumus. Gunakan Metode Rekursif. 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987, 1597….. Kumpulkan besok jam 2 di lab E201A Marsel Willem Aipassa, S. Kom.