Chapter 1
Chapter 1
Chapter 1
PROGRAMMING
LANGUAGES
ASSOC. PROF. TS. DR. ZAID BIN OMAR
SECTION : 05 & 06
2023/2024-1
What is Programming? (1/2)
• Let’s define a computer
• One that computes: a programmable electronic device that
can store, retrieve and process data.
• What is programming?
• Much of our behaviour is characterized by logical sequences.
• E.g. Turning a page by hand
1. Lift Hand
2. Move hand to the right side of book
3. Grasp top-right corner of page
4. Move Hand from right to left until page is positioned
5. Let go of page.
What is Programming? (2/2)
• What is programming? (cont.)
• Many things are done is a certain order of sequence. E.g. walking,
baking a cake, manufacture a pen etc.
• Solving math problems are done in a sequence.
• Describing the order and sequence of operations in a process is
called programming.
• In this course, we are going to learn about computer
programming.
Through step-by-step
diagrams. E.g. origami
How algorithms are described? (2/4)
Flowcharts
How algorithms are described? (3/4)
A programming language
is a simplified form of
English with math
symbols that adheres to
strict set of grammatical
rules.
e.g. C, C++, Python,
Javascript, Java
Scientific Programming Language
• Is a programming language optimized for the use of
mathematical formulas and matrices.
• Thus it is more suitable for performing
scientific/numerical computing.
• Math operations can be performed with any
programming language, however it is easier to be done
in a scientific programming language.
• E.g. MATLAB, Mathematica, FORTRAN
MATLAB
• Originally a simple language for matrix arithmetic
• Can now do most numerical scientific calculations
• Very heavily used for scientific/numerical computing
• Matlab has lots of specialist toolboxes
• Cost is high
• Free version available – Octave, Scilab
Arrows for
connectors
Disadvantages of flowchart
5. It takes long time to prepare to proper flowchart.
6. Translation of flowchart into program is sometimes
difficult. (that’s why pseudocode is preferred)
Example of flowchart : Sandwich
Start
End
Example of flowchart : ATM
Start
End
Pseudocode (1/6)
• Is a notational system in which ideas can be expressed
informally during algorithm development.
• Loose representation of formal language (e.g. C++ etc.)
• This is used when target programming language
unknown.
Pseudocode (2/6)
• We will use the following notations;