Professional Documents
Culture Documents
02-Tcp2103-Pre-Programming Tools
02-Tcp2103-Pre-Programming Tools
Chapter 2 : Introduction to
Programming
© Nurkhairizan’07
INTRODUCTION TO PROGRAMMING
Objectives
By the end of the lesson, student should
be able to
1. Define what is Programming
Language
2. Describe the evolution of
Programming Language
3. List the advantages of OOP
4. Describe what is OOP
INTRODUCTION TO PROGRAMMING
Content
• What is Programming
• What is Programming Language
• A Program (Software)
• Evolution of Computer Program
INTRODUCTION TO PROGRAMMING
Content
• What is Programming
• What is Programming Language
• A Program (Software)
• Evolution of Computer Program
INTRODUCTION TO PROGRAMMING
What is programming
• Computer programming (often
shortened to programming or coding)
is the process of writing, testing,
debugging/troubleshooting, and
maintaining the source code of
computer programs.
INTRODUCTION TO PROGRAMMING
Content
• What is Programming
• What is Programming
Language
• A Program (Software)
• Evolution of Computer Program
INTRODUCTION TO PROGRAMMING
Content
• What is Programming
• What is Programming Language
• A Program (Software)
• Evolution of Computer Program
INTRODUCTION TO PROGRAMMING
A Program (Software)
• Program is a set of instruction that tells
computer what to do.
• The instructions is written in
Programming Language.
INTRODUCTION TO PROGRAMMING
A Program (Software)
Software is
– applications
– operating systems and environments
– utilities: compilers, editors...
• all created by human effort
as collections of related programs
using programming languages
INTRODUCTION TO PROGRAMMING
Content
• What is Programming
• What is Programming Language
• A Program (Software)
• Evolution of Computer
Program
INTRODUCTION TO PROGRAMMING
Evolution of Computer
Programming
• The Generations of programming
languages
• Language generations 1,2,3
• High level languages: the evolution of
types of language
INTRODUCTION TO PROGRAMMING
Evolution of Computer
Programming
• The Generations of
programming languages
• Language generations 1,2,3
• High level languages: the evolution of
types of language
INTRODUCTION TO PROGRAMMING
Evolution of Computer
Programming
• The Generations of programming
languages
• Language generations 1,2,3
• High level languages: the evolution of
types of language
INTRODUCTION TO PROGRAMMING
Generations of
programming languages -& computers
programming languages computer architectures
1. machine lang 1. valves 1945
1945
2. assembly lang 1951
3. high level lang 1954 2. transistors 1959
60s 3. Integrated 1964
Circuits
4. 4GLs 70s
4. PCs many high
1981
5. AI based 80s level
6. network-aware 90s languages of
different
types
INTRODUCTION TO PROGRAMMING
Content
• What is Programming
• What is Programming Language
• A Program (Software)
• Evolution of Computer
Program
INTRODUCTION TO PROGRAMMING
Simula-67 Eiffel
Content
• Programming Approach
• What is OOP?
• What is Object?
• Advantage of OOP
INTRODUCTION TO PROGRAMMING
Content
• Programming Approach
• What is OOP?
• What is Object?
• Advantage of OOP
INTRODUCTION TO PROGRAMMING
Programming Approach
INTRODUCTION TO PROGRAMMING
Content
• Programming Approach
• What is OOP?
• What is Object?
• Advantage of OOP
INTRODUCTION TO PROGRAMMING
What is OOP
• Object oriented programming (OOP)
models the real world in terms of
object. A bicycle
• Object examples:
A tiger
A circle
A person
INTRODUCTION TO PROGRAMMING
Content
• Programming Approach
• What is OOP?
• What is Object?
• Advantage of OOP
INTRODUCTION TO PROGRAMMING
What is Object?
Objects are key to understanding
object-oriented technology.
Real-world objects share two
characteristics
state
Behavior
Identifying the state and behavior for
real-world objects is a great way to
begin thinking in terms of object-
oriented programming.
INTRODUCTION TO PROGRAMMING
Definition
An Object represents an
entity in the real world that
can be distinctly identified
INTRODUCTION TO PROGRAMMING
Object : A cat
Object : A bicycle
Software Object
Software objects are conceptually similar to
real-world objects:
stores its state in data fields (properties)
exposes its behavior through methods
(functions)
Content
• Programming Approach
• What is OOP?
• What is Object?
• Advantage of OOP
INTRODUCTION TO PROGRAMMING
Advantages of OOP
• Flexibility
– flexible interactions
• Modularity
– The source code for an object can be written
and maintained independently of the source
code for other objects.
• Clarity
– More understandable, better organized and
easier to maintain than procedural
programming
• Reusability
– Classes provide the benefit of reusability
TCP2103 : INTRODUCTION TO PROGRAMMING
The End
© Nurkhairizan’07
INTRODUCTION TO PROGRAMMING
QUIZ
• What is Programming Language?
• Give 3 example of High-level Programming
Language.
• What is Object. Give 2 example of object and
list all possible state (properties) and
behavior (method) for the object
• List 4 advantages of Object Oriented
Programming.
INTRODUCTION TO PROGRAMMING
Structured Programming
INTRODUCTION TO PROGRAMMING
Content
• Programming Approach
• Advantages of Structured
Programming
• Method of solving problem using
structured programming
INTRODUCTION TO PROGRAMMING
Content
• Programming Approach
• Advantages of Structured
Programming
• Method of solving problem using
structured programming
INTRODUCTION TO PROGRAMMING
Programming Approach
INTRODUCTION TO PROGRAMMING
Content
• Programming Approach
• Advantages of Structured
Programming
• Method of solving problem using
structured programming
INTRODUCTION TO PROGRAMMING
What is Structured
Programming(SP)?
• In the world of computer programming,
structured programming is a logical
construct that allows for the efficient
operation of a program. With this in
mind, many programmers understand
structured programming as being one of
the disciplines that make up the overall
process of procedural programming.
INTRODUCTION TO PROGRAMMING
Content
• Programming Approach
• Advantages of Structured
Programming
• Method of solving problem using
structured programming
INTRODUCTION TO PROGRAMMING
Sequence Structure
Write a
•Can contain any symbol line
Do
Average
INTRODUCTION TO PROGRAMMING
Decision Structures
If…Then…Else
If…Then
Case
INTRODUCTION TO PROGRAMMING
If…Then
Is
Add 1 to
Code =
1? Yes Code1-Count
No
INTRODUCTION TO PROGRAMMING
If…Then…Else
Is
Gender =
No "F"? Yes
Do Male Do Female
Do Benefit-
Analysis
INTRODUCTION TO PROGRAMMING
Case
Value = ?
=0 >0
<0
Bottom-test
loop
INTRODUCTION TO PROGRAMMING
Done = ? D o P ro ce s s
"Yes"
"No"
Done = ?
Do Process "Y e s "
"N o "
It is neither a top-
test nor bottom-test
loop.
The loop is
invalid!!!!!!
In structured programming the
decision to leave the loop must be
the first instruction or the last
instruction in the loop
INTRODUCTION TO PROGRAMMING
Structured programming
produced significant
improvements in software
quality and development
time…
INTRODUCTION TO PROGRAMMING
Entrance 1 Entrance 2
into structure into structure
The End
© Nurkhairizan’07
INTRODUCTION TO PROGRAMMING
EXERCISE
• What is Programming Language?
• Give 3 example of High-level Programming
Language.