0% found this document useful (0 votes)
15 views19 pages

Pp2intro 220503213712

Uploaded by

bgjt.susovan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views19 pages

Pp2intro 220503213712

Uploaded by

bgjt.susovan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 19

INTRODUCTION TO

PROGRAMMING

EXPLANATION OF TERMS
OBJECTIVES
By the end of the lesson, you should be to:
Define program
Define programming
Define programming language
State and explain the various classes of programming language.
DEFINITION OF PROGRAM

A program is a set of instructions that tell


the computer how to perform a task.
Example of a program includes: Mavis
Beacon, word processor, Encarta, etc.
Programmers or Software Developers:

• They are the individuals that create computer software.


• They have the training and skill to design, create, and
test computer programs.
PROGRAMMING

Programming is the process of creating a set of instructions


that tell the computer how to perform a task. Programming
can be done using a variety of computer “languages” such as
SQL, java, Python, C++ etc.
The main purpose of programming is to tell the computer
what to do.
PROGRAMMING LANGUAGE (PL)

Programming language is a formal constructed


language designed to communicate instructions
to a computer. PL are use to create programs to
control the behaviour of a computer.
CLASSIFICATION OF PL
Programming language can be classified into
three main category, namely:
1940‘s -- Machine Languages
1950‘s -- Symbolic Languages
1960‘s -- High Level Languages
MACHINE LANGUAGE

In the earliest days of computers, the only programming


languages available were machine languages. Each computer
has its own machine language which is made of streams of 0‘s
and 1‘s. The instructions in machine language must be in
streams of 0‘s and 1‘s. This is also referred as binary digits.
These are so named as the machine can directly understood
the programs and it is a low level language. ML are also known
as first-generation languages.
ADVANTAGES AND DISADVANTAGES
Advantages:
• 1) High speed execution
• 2) The computer can understood instructions immediately
• 3) No translation is needed.

Disadvantages:
• 1) Machine dependent
• 2) Programming is very difficult
• 3) Difficult to understand
• 4) Difficult to write bug free programs
• 5) Difficult to isolate an error
EXAMPLE
Example
Addition of two numbers
2  0010
+
3  0011
--- ---------------
5  0101
--- ---------------
SYMBOLIC LANGUAGES (OR) ASSEMBLY
LANGUAGE
In the early 1950‘s Admiral Grace Hopper, a mathematician and naval
officer, developed the concept of a special computer program that
would convert programs into machine language. These early
programming languages simply mirrored the machine languages using
symbols or mnemonics to represent the various language instructions.
These languages were known as symbolic languages.
SYMBOLIC LANGUAGES (OR) ASSEMBLY LANGUAGE (CONT’D)

Because a computer does not understand symbolic language it


must be translated into the machine language. A special
program called an Assembler translates symbolic code into the
machine language. Hence they are called as Assembly language.
They are also known as second-generation languages.
SYMBOLIC LANGUAGES (OR) ASSEMBLY LANGUAGE (CONT’D)

Advantages:
• 1) Easy to understand and use
• 2) Easy to modify and isolate error
• 3) High efficiency
• 4) More control on hardware
SYMBOLIC LANGUAGES (OR) ASSEMBLY LANGUAGE (CONT’D)

Disadvantages:
• 1) Machine Dependent Language
• 2) Requires translator
• 3) Difficult to learn and write programs
• 4) Slow development time
• 5) Less efficient
EXAMPLE
• Example: Add two numbers. E.g. 2 and 3.
2 PUSH 2,A
3 PUSH 3,B
+ ADD A,B
5 PRINT C
HIGH LEVEL LANGUAGES
All high-level languages are procedure-oriented
languages and intended to be machine
independent. Programs are written in statements
in English-like language, a great advantage over
mnemonics in assembly languages which requires
Assembler to translate it to machine readable
language. These languages require translators
(compilers and interpreters) for execution.
HIGH LEVEL LANGUAGES (CONT’D)
The early high-level languages come in the third generation languages,
COBOL, BASIC, APL, JAVA, C++, C+ etc. these languages enable the
programmers to write instructions in English words and familiar
mathematical symbols which makes it easier than technical details of
the computer.
HIGH LEVEL LANGUAGES (CONT’D)
• Advantages:
• 1) Easy to write and understand
• 2) Easy to isolate an error
• 3) Machine independent language
• 4) Easy to maintain
• 5) Better readability
• 6) Low Development cost
• 7) Easier to document
• 8) Portable
HIGH LEVEL LANGUAGES (CONT’D)
• Disadvantages:
• 1) Needs translator
• 2) Requires high execution time
• 3) Poor control on hardware
• 4) Less efficient

You might also like