Professional Documents
Culture Documents
Lecture 1
Lecture 1
Lecture 1
FUNDAMENTALS OF
PROGRAMMING
University of Kelaniya
Sri Lanka
Fundamentals of Programming
COSC / COST 11023
INTRODUCTION
SACHINTHA PITIGALA
piti@kln.ac.lk
< 3 >
Introduction to the art of
Programming
< 4 >
< 5 >
New to Programming?
1. PRACTICE
2. PRACTICE
3. PRACTICE
< 6 >
What are the uses of
Computers?
< 7 >
Computers allow us to do:
< 8 >
Computers allow us to do:
< 9 >
Computers allow us to do:
< 10 >
Computers allow us to do:
< 11 >
Computers allow us to do:
< 12 >
Computers allow us to do:
< 13 >
Computers allow us to do:
< 14 >
Computers allow us to do:
< 15 >
So… What is a Computer?
< 16 >
Is it a Magical Device?
< 17 >
What is a Computer?
•Computer is a programmable electronic
device that can store, retrieve, and
process data.
< 18 >
Memory Organisation of a Computer
• Computer is an electronic device.
< 19 >
65 - 54 53
A - 65
American
Standard Code
for Information
Interchange
(ASCII) <20 >
In the Beginning…..
< 21 >
Now…
< 22 >
Human vs Computer
• Univeristy of Kelaniya
< 23 >
Computers are not intelligent
< 24 >
< 25 >
But….
• Computers be able to:
• Performs calculations accurately
• Performs calculations quickly
• Remembers information (results)
12 + 3 + 5 + 8 + 9 + 9 + 2 + 4 + 11 + 3 + 7 + 7 + 8 + 9 + 3
< 26 >
< 27 >
< 28 >
What is a Computer Program?
•A sequence of instructions to be provided
to a computer to solve a problem.
< 29 >
What is a Computer Programming?
•It is the process of planning and writing a
sequence of steps (called instructions) for
computer to follow .
STEP 1
STEP 2
STEP 3
. . .
< 30 >
How we can communicate with
computers?
Using a Language
< 31 >
What is Programming Language?
< 32 >
fi
Examples
< 33 >
Types of Programming Languages
•Machine Language
•Assembly Languages
•High-Level Languages
< 34 >
Machine Language
< 35 >
Machine Language
• For Example,
cost=price+tax
< 36 >
Machine Language
Advantages Disadvantages
Speci c to computer
Ef cient use of memory
architecture (not portable)
< 37 >
fi
fi
Assembly Languages
< 38 >
Assembly Languages
• For Example,
cost=price+tax
ADD R2, R3
MOV R1
Assembly Languages
0010 0000 0000 0100
ADD R2, R3 0100 0000 0000 0101
MOV R1 0011 0000 0000 0110
0101 0000 0010 0110
< 40 >
Assembly Language
Advantages Disadvantages
Speci c to computer
Ef cient use of memory
architecture (not portable)
< 41 >
fi
fi
High Level Languages
< 42 >
High Level Languages
< 43 >
< 44 >
High-Level Languages
< 45 >
High-Level Languages
Translator Machine-
High-level Compiler language
Language Program
< 46 >
< 47 >
High Level Languages
Advantages Disadvantages
< 48 >