1 / 12

Pertemuan 01 Algorithm

Pertemuan 01 Algorithm. Matakuliah : D0524 / Algoritma dan Pemrograman Komputer Tahun : 2005 Versi :. Learning Outcomes. Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : Menerapkan prinsip – prinsip dasar algoritma menggunakan pseudo code dan flowchart. Outline Materi.

abie
Télécharger la présentation

Pertemuan 01 Algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Pertemuan 01Algorithm Matakuliah : D0524 / Algoritma dan Pemrograman Komputer Tahun : 2005 Versi :

  2. Learning Outcomes Pada akhir pertemuan ini, diharapkan mahasiswa akan mampu : • Menerapkan prinsip – prinsip dasar algoritma menggunakan pseudo code dan flowchart

  3. Outline Materi • History of Algorithm • Algorithm Definition • Algorithm Implementation • Examples of Algorithm

  4. History of Algorithm • The word algorithm comes from the name of the 9th century Persian mathematician Abu Abdullah Muhammad bin Musa al-Khwarizmi. • The word algorism originally referred only to the rules of performing arithmetic using Arabic numerals but evolved into algorithm by the 18th century. The word has now evolved to include all definite procedures for solving problems or performing tasks. • The first case of an algorithm written for a computer was Ada Byron's notes on the analytical engine written in 1842, for which she is considered by many to be the world's first programmer. • The lack of mathematical rigor in the "well-defined procedure" definition of algorithms posed some difficulties for mathematicians and logicians of the 19th and early 20th centuries. This problem was largely solved with the description of the Turing machine, an abstract model of a computer formulated by Alan Turing. • Nowadays, a formal criterion for an algorithm is that it is a procedure that can be implemented on a completely-specified Turing machine or one of the equivalent formalisms. Abu Abdullah Muhammad bin Musa al-Khwarizmi

  5. Algorithm Definition • Algorithm is a finite set of well-defined instructions for accomplishing some task which, given an initial state, will terminate in a corresponding recognizable end-state • In short, algorithm is a step–by–step procedure to solve a problem • Computer has no intelligence of its own – it cannot solve our mistakes!

  6. Algorithm Implementation • Flowchart • a schematic representation of a process. They are commonly used in business/economic presentations to help the audience visualize the content better, or to find flaws in the process • Pseudocode • a generic way of describing an algorithm using the conventions of programming languages. As the name suggests, pseudocode generally does not actually use the syntax of any particular language; there is no systematic standard form, although any particular writer will generally borrow the appearance of a particular language • depending on the writer, pseudocode may therefore vary widely in style, from a near-exact imitation of a real programming language at one extreme, to a description approaching formatted prose at the other

  7. Algorithm Implementation - Flowchart Common Flowchart Symbols Terminal : Start or end of a program Computational steps or processing function of a program Input or output operation Decision making and branching Connector or joining of two parts of program Flow Line

  8. Algorithm Implementation - Flowchart A simple flowchart for what to do if a lamp doesn't work

  9. Algorithm Examples – Wake Up • We use algorithms all the time. Here is a typical algorithm for waking up in the morning. Wake-up algorithm: Get out of bed Brush teeth Eat breakfast Take shower Get dressed

  10. Algorithm Examples – Temperature Conversion • The local weather centre wants a computer program that will accept a temperature reading in degrees Fahrenheit as input, convert the value to degrees in Celsius and provide both values as output, for its hourly weather report. • Develop the program logic as flowchart and pseudocode needed to solve the problem

  11. Algorithm Examples – Temperature Conversion • Pseudocode: Input degreesF degreesC = (degreesF-32) * 5/9 Output degreesF and degreesC • Flowchart : Start Input degreesF Or degreesC = (degreesF-32) * 5/9 Convert degreesF to degrees C Output degreesF and degrees C End

  12. Algorithm Examples – Exercises • Sales Application: • In a company, a salesperson’s pay is determined by how much they have sold in a month. Sales are of two types, items sold at regular price and those at sale price. Each person is paid a base amount of £920 plus a commission of 6% on regular-price sales and 3% on reduced-price sales. • Design the algorithm (program logic) to calculate their pay. • Average Mark: • A student gains 45, 53, 58 marks in three tests. • Design an algorithm to input that information and output their average mark.

More Related