2. Introduction to Algorithm and Programming

Slides:



Advertisements
Presentasi serupa
Pseudocode & Flowchart
Advertisements

Perth Chart & Critical Path Method
Algoritma : CONTROL STRUCTURES
1 Algoritma Bahasa Pemrograman dan Bab 1.1. Pengertian Algoritma.
Function.
Modul-8 : Algoritma dan Struktur Data
Pemrograman Berorientasi Objek Bab 1 – Pemrograman Terstruktur.
Information Systems, Organizations, and Strategy
Fungsi Lecture 7. Motivation Complexity of programming problem  more difficult to consider the solution as a whole  clue: dividing the problem into.
Learning Medium School : SMPN 1 Gotham City Subject : English
RESOLUTION DECISIONS.. “Do I STAY? Or should I GO?” “Is He (or She) the RIGHT one for me?” “Should I BUY this? Or SELL that?” “Should I INVEST in.
Chapter 1-a FLOW CHART.
WHAT IS MULTIPLE CRITERIA ANALYSIS?
K-Map Using different rules and properties in Boolean algebra can simplify Boolean equations May involve many of rules / properties during simplification.
Activity Diagram Shinta P.. For Bussiness Modeling, Activity diagrams describe the activities of a class. It is used for the following purposes: (Bennet.
MATERIAL RESOURCE PLANNING
Pertemuan Operasi Seleksi
REPETITION CONTROL STRUCTURES
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 12 Pengkodean & Implementasi Matakuliah: T0234 / Sistem Informasi Geografis Tahun: 2005 Versi: 01/revisi 1.
Masalah Transportasi II (Transportation Problem II)
Bina Nusantara Mata Kuliah: K0194-Pemodelan Matematika Terapan Tahun : 2008 Aplikasi Model Markov Pertemuan 22:
HAMPIRAN NUMERIK SOLUSI PERSAMAAN NIRLANJAR Pertemuan 3
1 HAMPIRAN NUMERIK SOLUSI PERSAMAAN LANJAR Pertemuan 5 Matakuliah: K0342 / Metode Numerik I Tahun: 2006 TIK:Mahasiswa dapat meghitung nilai hampiran numerik.
1 Pertemuan 5 Komunikasi antar Proses / Interprocess Communication (IPC) Matakuliah: T0316/sistem Operasi Tahun: 2005 Versi/Revisi: 5 OFFCLASS01.
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.
Introduction Chapter 3 – Three Pictures of the Church: 1.The Family 2.The Field 3.The Temple Chapter 4 – Three Pictures of the Minister: 1.A Steward (vs.
OPERATOR DAN FUNGSI MATEMATIK. Operator  Assignment operator Assignment operator (operator pengerjaan) menggunakan simbol titik dua diikuti oleh tanda.
The following short quiz consists of 4 questions and tells whether you are qualified to be a "professional". The questions are not that difficult, so.
Flowchart.
ILIMA FITRI AZMI TEACHING MATERIAL DEVELOPMENT
Konsep Pemrograman 3
KOMUNIKASI DATA Materi Pertemuan 3.
Buy Famvir Online Canada
Konsep pemrograman LOOP
KOMUNIKASI DATA S. Indriani L, M.T
Dasar-Dasar Pemrograman
CA113 Pengantar Manajemen Bisnis
Bahasa Pemprograman Dasar Pertemuan 4
Struktur Algoritma Sequence Process: instruksi dikerjakan secara sekuensial, berurutan. Selection Process: instruksi dikerjakan jika memenuhi kriteria.
Pseudo-code.
Algorithms and Programming Searching
CA113 Pengantar Manajemen Bisnis
Bahasa Pemrograman (Pemrograman Visual)
Kk ilo Associative entity.
Teknik Pengujian Software
Pertemuan 4 CLASS DIAGRAM.
DASAR-DASAR ALGORITMA dan FLOW CHART
A SMALL TRUTH TO MAKE LIFE 100%. Hard Work H+A+R+D+W+O+R+K = 98% Knowledge K+N+O+W+L+E+D+G+E = 96%
How to Set Up AT&T on MS Outlook ATT is a multinational company headquartered in Texas. ATT services are used by many people widely across.
Don’t Forget to Avail the Timely Offers with Uber
Story of Successful Events, How Visions Becomes Reality.
Suhandi Wiratama. Before I begin this presentation, I want to thank Mr. Abe first. He taught me many things about CorelDRAW. He also guided me when I.
CA113 Pengantar Manajemen Bisnis
Simultaneous Linear Equations
Flowchart.
Algoritma & Pemrograman 1 Achmad Fitro The Power of PowerPoint – thepopp.com Chapter 3.
Lesson 2-1 Conditional Statements 1 Lesson 2-1 Conditional Statements.
HughesNet was founded in 1971 and it is headquartered in Germantown, Maryland. It is a provider of satellite-based communications services. Hughesnet.
 Zoho Mail offers easy options to migrate data from G Suite or Gmail accounts. All s, contacts, and calendar or other important data can be imported.
How do I Add or Remove a delegate to my Gmail account? Google launched delegation service 9 years ago for Gmail that allows you to give permission to access.
SIMILES. The comparison is carried out using the words ‘like’ as etc. Example : 1. as free as a bird. The word ‘free’ is compared with the word ‘bird’
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.
Rank Your Ideas The next step is to rank and compare your three high- potential ideas. Rank each one on the three qualities of feasibility, persuasion,
Module M1 – Solar panels TEST 1 TOT-M1-A-TE_00_00_001 1.
2. Discussion TASK 1. WORK IN PAIRS Ask your partner. Then, in turn your friend asks you A. what kinds of product are there? B. why do people want to.
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:

2. Introduction to Algorithm and Programming Algoritma dan Pemrograman – Teknik Informatika UK Petra 2009

Flowcharts and Pseudo Code A “Standard” way of describing an algorithm must exist if we expect our solution to be understood by others easily There are two standards in programming: FLOWCHARTS PSEUDOCODE

Flowcharts A Flowchart is a Visual Representation of an algorithm A Flowchart uses easy-to-understand symbols to represent actions on data and the flow of data Flowcharts aid in breaking down a problem into simple steps

Pseudo Code “Pseudo” means “pretend” or “false” Pseudo Code is pretend or false computer code; generic English-like terms that are somewhat like computer code Pseudo Code is not as standardized as flowcharts, and does not facilitate the breaking down of problems as well as a flowchart does

The Three Computer Programming Constructs Any problem, regardless of how complex, can be broken down into three basic CONSTRUCTS SEQUENCE SELECTION ITERATION

Sequence Sequence is the most basic of the constructs It is simply performing one step after another Each step is followed in a specific sequence, hence the name Sequence can be thought of as “do this, then do this, then do this”

Selection Selection is the decision-making construct It is used to make yes/no or true/false decisions logically Selection can be thought of as “if something is true take this action, otherwise take that action”

Iteration Iteration comes from the word “reiterate”, which means to repeat Iteration is a looping construct Iteration is a combination of decision and sequence and can repeat steps Iteration can be thought of as “while something is true, do this, otherwise stop”

Visualizing The Constructs By using Flowchart symbols, we can visualize the three basic computer constructs Every algorithm ever created is made up of only these three constructs

Basic Flowchart Symbols Process Input/Output Terminator Decision Connector Data Flow Initialization

The Basic Flowchart Symbols The terminator shows where a specific piece of an algorithm beings and ends A process is a basic action or actions on data A decision is a logical test with two possible data paths resulting from one

The Basic Flowchart Symbols Input/Output gets data or displays information to the user of the algorithm A connector connects two or more data flows into one A data flow shows the direction of data’s movement through the algorithm

Sequence

Selection

Selection Single Selection (if) Double Selection (if-else) If you’ve won the lottery: raise your hand Double Selection (if-else) If you’re happy: smile else: frown

Selection (continued) Multiple Selection (switch) If the light is ... red -> stop green -> go yellow -> slow down

Iteration/ Repetition

Iteration/ Repetition… While Do-while while it’s still clumpy Stir the mixture ask parents if must eat vegetables while parents say “Yes”

Iteration/ Repetition… For Teaching a baby to count from 1 to 10: counter = 1 if counter <= 10: increment counter print counter number

Contoh : Arnie sangat menyukai jogging pagi. Selama ia jogging, ia menghitung berapa langkah yang ditempuh selama menit pertama dan menit terakhir. Kemudian Arnie menghitung rata-rata dari menit pertama dan terakhir kemudian menganggap bahwa rata-rata ini dapat mewakili rata-rata langkah setiap menitnya. Buat program yang menerima rata-rata langkah yang dibuat setiap menitnya dan total waktu yang ditempuh Arnie untuk jogging dalam jam dan menit, lalu menampilkan jarak yang ditempuh Arnie dalam mil. Asumsi 1 langkah yang dibuat Arnie adalah 2,5 feet. (1mil sama dengan 5280 feet).

Output : Jarak yang ditempuh sewaktu joging (mil) Jawab : Baca problem Buat program untuk menghitung jarak yang ditempuh Arnie (dalam mil) sewaktu ia lari pagi, jika rata-rata banyaknya langkah yang dibuat dalam tiap menit dan waktu yang diperlukan untuk joging (dalam jam dan menit) diinput. Asumsi 1 langkah = 2.5 feet dan 1 mil = 5280 feet. Analisis Input : rata-rata langkah yang dibuat dalam 1 menit, waktu joging dalam jam dan menit. Output : Jarak yang ditempuh sewaktu joging (mil)

Output : Jarak yang ditempuh sewaktu joging (mil) Jawab : Baca problem Buat program untuk menghitung jarak yang ditempuh Arnie (dalam mil) sewaktu ia lari pagi, jika rata-rata banyaknya langkah yang dibuat dalam tiap menit dan waktu yang diperlukan untuk joging (dalam jam dan menit) diinput. Asumsi 1 langkah = 2.5 feet dan 1 mil = 5280 feet. Analisis Input : rata-rata langkah yang dibuat dalam 1 menit, waktu joging dalam jam dan menit. Output : Jarak yang ditempuh sewaktu joging (mil)

Informasi tambahan : 1 mil = 5280 feet, 1 langkah = 2.5 feet Format output : - Perancangan : Baca Rata, Jam, menit Hitung Jarak Jarak = (Rata (60 * jam + menit) 2.5)/5280 Cetak Jarak

Jarak = (Rata (60* jam + menit) 2.5)/5280 Start Baca Jam, menit, Rata Jarak = (Rata (60* jam + menit) 2.5)/5280 Cetak Jarak Stop

Latihan Budi sekarang duduk di kelas 2 sekolah dasar ‘AyahBunda’. Salah satu pelajaran yang disukai Budi adalah matematika. Pada pokok bahasan belajar perkalian, semua murid kelas 2 mendapat tugas untuk menghitung luas kamar tidur masing-masing. Tolong Anda bantu Budi menghitung luas kamar tidurnya!. Bu Dora menjual mangga dengan harga Rp 500 per buah. Seorang pembeli akan mendapatkan diskon sebesar 10% jika total pembeliannya di atas Rp 50.000. Tampilkan total yang harus dibayar seorang pembeli, besarnya diskon yang didapat dan total yang harus dibayar sesudah dikurangi dengan diskon.

Menentukan apakah sebuah bilangan yang diinputkan merupakan bilangan positif atau negatif (asumsi 0 = bilangan positif) Hitung nilai dari n2, jika operator aritmatika yang diperbolehkan adalah penjumlahan. Menghitung jumlah deret : 1 + 2 + 6 + 24 + … + (suku ke-(n-1) * suku ke-n) Tampilkan suku-suku dari deret berikut selama jumlahnya masih kurang dari n 1, 2, 4, 8, 16, ….