Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

DEC 20012

Programming Fundamental
CHAPTER 1:
INTRODUCTORY TO PROGRAMMING
Notes 1.3

1
1.2: Know The Definition of Programming

Definition Of :
Ø Program:
l A set of step-by-step instructions that directs a
computer to perform a specific task and to
produce the required results.
Ø Programming:
l Programming is a process of designing/ creating
a program.
Ø Programmer:
l Programmer is a person who writes the program.

2
1.2: Know The Types of Programming

Various Types of Programming Languages

a. Machine languages
b. Assembly languages
c. High Level languages

3
1.2: Know The Types of Programming

Machine Language
• The lowest level of language.
• Uses 1s and Os / binary digits to represents data and instructions
• Examples: 0 represents “off” and 1 represents “on”.
• The only language that the computer could understand (does not require translator).

4
1.2: Know The Types of Programming

Assembly Language
• Known as symbolic language.
• It uses mnemonic codes - a symbol chosen to help user to remember
• replace “0” and “1”
• For example, A represented ADD and S represented SUM
• Computer does not understand the language so it needs an assembler to translate the program to
machine language.

5
1.2: Know The Types of Programming

High Level Language

• Instruction is written as a series of English-like words.


• Translator (Compiler/Interpreter) is needed to translate high level language to machine
language.
• It is Machine-Independent. The program can be written and executed on any computer.
• Example: FORTRAN, Pascal, BASIC, C, C++, Java, etc.

6
1.2: Know The Types of Programming

Some Well-known Programming Languages:

7
1.3: Know The Types of Programming

Types of Programming and Structure Programming Methodology


Ø Structured Programming
Ø Modular Programming
Ø Object-Oriented Programming

8
1.2: Know The Types of Programming

Structured Programming
Ø Structured programming takes on the top-to-bottom approach.
Ø Structured programming is based around data structures and subroutines.
Ø It splits the tasks into modular forms. This makes the program simpler and easier to read with less lines
and codes.
Ø This type of program accomplishes certain tasks for that a specific reason.
Ø For example, invoice printers use structured programming. This type has clear, correct, precise
descriptions.
Ø A structured program is decomposed into a hierarchy of processes. A process in this context is a body of
code, typically a function or subroutine, that takes some input and manipulates it to produce an output.
Ø A process may be composed of other, more specialized processes, i.e., it may be a function that calls other
functions.

9
1.2: Know The Types of Programming

Modular Programming
Ø Modular programming is a software design technique that increases the extent to which software is
composed from separate parts, called modules.
Ø Execution of a program begins in the main function.
Ø The main function can call other functions:
A. Functions defined in the same file.
B. Function defined in other files or libraries
Ø Functions are also referred to as modules
Ø A module is a set of statements that performs a task or computes a value

10
1.2: Know The Types of Programming

Object Oriented Programming


Ø The object-oriented approach refers to a special type of programming approach that combines data with
functions to create objects.
Ø In an object-oriented program, the object have relationships with one another.
Ø One of the earliest OOP languages is Smalltalk. Java, Visual Basic and C++ are examples of popular OOP
languages.
Ø One of the earliest OOP languages is Smalltalk. Java, Visual Basic and C++ are examples of popular OOP
languages.
Ø This type of programming uses sections in a program to perform certain tasks.
Ø It splits the program into objects that can be reused into other programs.
Ø They are small programs that can be used in other software.
Ø Each object or module has the data and the instruction of what to do with the data in it. This can be
reused in other software .
Ø An object-oriented program is decomposed into a network of collaborating objects. An object represents a
thing or concept

11
Thank You!!

12

You might also like