Algorithm
Flowchart
and
Programming
Dediary
Prasetya
People have problems
computer can compute
People need computer
to solve the problems
How to make
a program
in order
to solve
the Problems?
Algorithm
• In mathematics and computer science, an
algorithm (i/ˈælɡərɪðəm/ AL-gə-ri-dhəm) is a
step-by-step procedure for calculations.
Algorithms are used for calculation,
data processing, and automated reasoning.
• An informal definition could be "a set of rules
that precisely defines a sequence of
operations.”
Thanks to Al Khawarizmi
(Abū ʿAbdallāh Muḥammad ibn Mūsā al-Khwārizmī)
• (c. 780 – c. 850) was a
Persian, mathematician,
astronomer and
geographer during the
Abbasid Caliphate,
• a scholar in the
House of Wisdom in
Baghdad.
Algebra
• His systematic approach to
solving linear and
quadratic equations led to
algebra, a word derived from
the title of his 830 book on
the subject, "The
Compendious Book on
Calculation by Completion
and Balancing" (al-Kitab al-
mukhtasar fi hisab al-jabr
wa'l-muqabalaالكتاب المختصر في
)حساب الجبر والمقابلة.
The algorithm is the basic technique used to get the job done.
• Example 1: Go home from airport
• Here are four different algorithms that you might give your
friend for getting to your home from airport:
– The taxi algorithm:
• Go to the taxi stand. Get in a taxi. Give the driver my address.
– The call-me algorithm:
• When your plane arrives, call my cell phone. Meet me outside
baggage claim.
– The rent-a-car algorithm:
• Take the shuttle to the rental car place. Rent a car. Follow the directions to
get to my house.
– The bus algorithm:
• Outside baggage claim, catch bus number 70. Transfer to bus 14 on Main
Street. Get off on A Yani street. Walk two blocks north to my house.
You can then start to formalize algorithms by
setting them out as flowcharts
• Example 2: Make Tea
– START
– Get the water into the
kettle
– Turn on the power
– Check the boiled water
– If the kettle has boiled,
– Then make tea
– END
Computer programming
• Computer programming (often shortened to
programming) is a process that leads from
an original formulation of a computing
problem to executable programs.
• It involves activities such as analysis, understanding, and
generically solving such problems resulting in an
algorithm, verification of requirements of the algorithm
including its correctness and its resource consumption,
implementation (commonly referred to as coding) of the
algorithm in a target programming language.
Exercise:
Make an algorithm one of your activity and then
draw it as a flowchart!