INTRODUCTION TO
PROGRAMMING
By Mudasir Zaheer
PROGRAM
• A computer program is a collection of instructions that can be executed by
a computer to perform a specific task.
• A computer program is usually written by a computer programmer in
a programming language.
PROGRAM DEVELOPMENT PROCESS
• A programmer has to go through the following stages to develop the computer program:
1. Defining and analyzing problem
2. Designing the Algorithm
3. Coding or writing the problem
4. Testing program
5. Final Documentation
PROGRAMMING LANGUAGES
• Programming Languages allow programmers to develop software.
• The major families of languages are:
 Low Level Languages
Machine Language
Assembly languages
 High level languages
Machine Languages
Computers respond only to machine language
This language is in terms of binary codes (0,1). i.e. all programs should be
written with these codes, which is difficult, time consuming and leading to
errors while writing the programs
There is no unique standard machine language. Rather there are many
machine languages.
These are machine dependent
These are referred as the first-generation languages
Assembly Languages
It uses mnemonic codes rather than numeric codes (as in machine
languages)
Example: Add or A is used as a symbol for addition. It requires translators to
convert into machine language
Like machine language, writing program in assembly language is also time
consuming
These are also machine dependent
These are referred as the Second-generation languages
High-level Language (HLL)
• A high-level language (HLL) is a programming language such as C, FORTRAN,
or Pascal that enables a programmer to write programs that are more or
less independent of a particular type of computer.
• Such languages are considered high-level because they are closer to human
languages and further from machine languages.
• Syntax is similar to English.
High-level Language (HLL)
• High level languages are divided into the following categories:
• Procedural Language
1. FORTRAN
2. BASIC
3. COBOL
4. PASCAL
5. C
• Object-Oriented Languages
1. C++
2. JAVA SCRIPT
• NON-Procedural Languages
1.SQL
2. RPG (Report Program Generator)
EXAMPLE
Assembly
Language
MACHINE LANGUAGE HIGH LEVEL LANGUAGE
NATURAL PROGRAMMING LANGUAGE
• Natural Programming language known as fifth Generational Language.
• It is also known as Intelligent Language.
• Translator for these programs are very complex.
• This language is still in experimental process.
TYPES OF CODES
1. Source Code
• Program written in High Level language is called Source code.
• Source code is also called source program.
• Computer cannot understand the statements of high level language.
• Source code cannot be executed by computer directly.
• Source code converted into object code and then executed.
TYPES OF CODES
2. Object Code
• Program written in Machine Language is called object Code.
• Object code is also called object Program.
• Object code is also machine code.
• Computer understand object code directly.
LANGUAGE PROCESSOR
• Language Processor or Translator is a software that converts these programs
into machine language
• Every computer language has its own translators
• Different Types of language processors are as follows:
1. Compiler
2. Interpreter
3. Assembler
LANGUAGE PROCESSOR
1. Compiler
• Coverts the instruction of high level language into machine language as a
Whole.
• Compiler converts source program into machine code known as object program.
• Compiler checks each statement in the source program and generates
machine instructions.
• Compiler also checks syntax errors.
• Source program containing error can not be compiled.
• Compiler can translate the program of only that language in which it is written.
Source Program Object Program
COMPILER
LANGUAGE PROCESSOR
2. Interpreter
• Converts one statement of a program at one time.
• It execute the statement before translating the next statement of source
program
• If there is an error in the statement compiler stops working and display
error message.
• Programmer can correct error during program development.
• Visual Basics use Interpreter
LANGUAGE PROCESSOR
3. Assembler
• Translating Program
• Translates the instruction of assembly language into Machine Language.
Assembly Language Program Object Program
ASSENMBLER
TASK
1. Difference between Low level languages and High
level languages. (4 to 5)
2. Difference between Procedural and NON-Procedural
Language. (3 to 4)

Intro to programming languages by 4.pptx

  • 1.
  • 2.
    PROGRAM • A computerprogram is a collection of instructions that can be executed by a computer to perform a specific task. • A computer program is usually written by a computer programmer in a programming language.
  • 3.
    PROGRAM DEVELOPMENT PROCESS •A programmer has to go through the following stages to develop the computer program: 1. Defining and analyzing problem 2. Designing the Algorithm 3. Coding or writing the problem 4. Testing program 5. Final Documentation
  • 4.
    PROGRAMMING LANGUAGES • ProgrammingLanguages allow programmers to develop software. • The major families of languages are:  Low Level Languages Machine Language Assembly languages  High level languages
  • 5.
    Machine Languages Computers respondonly to machine language This language is in terms of binary codes (0,1). i.e. all programs should be written with these codes, which is difficult, time consuming and leading to errors while writing the programs There is no unique standard machine language. Rather there are many machine languages. These are machine dependent These are referred as the first-generation languages
  • 6.
    Assembly Languages It usesmnemonic codes rather than numeric codes (as in machine languages) Example: Add or A is used as a symbol for addition. It requires translators to convert into machine language Like machine language, writing program in assembly language is also time consuming These are also machine dependent These are referred as the Second-generation languages
  • 7.
    High-level Language (HLL) •A high-level language (HLL) is a programming language such as C, FORTRAN, or Pascal that enables a programmer to write programs that are more or less independent of a particular type of computer. • Such languages are considered high-level because they are closer to human languages and further from machine languages. • Syntax is similar to English.
  • 8.
    High-level Language (HLL) •High level languages are divided into the following categories: • Procedural Language 1. FORTRAN 2. BASIC 3. COBOL 4. PASCAL 5. C • Object-Oriented Languages 1. C++ 2. JAVA SCRIPT • NON-Procedural Languages 1.SQL 2. RPG (Report Program Generator)
  • 9.
  • 10.
    NATURAL PROGRAMMING LANGUAGE •Natural Programming language known as fifth Generational Language. • It is also known as Intelligent Language. • Translator for these programs are very complex. • This language is still in experimental process.
  • 11.
    TYPES OF CODES 1.Source Code • Program written in High Level language is called Source code. • Source code is also called source program. • Computer cannot understand the statements of high level language. • Source code cannot be executed by computer directly. • Source code converted into object code and then executed.
  • 12.
    TYPES OF CODES 2.Object Code • Program written in Machine Language is called object Code. • Object code is also called object Program. • Object code is also machine code. • Computer understand object code directly.
  • 13.
    LANGUAGE PROCESSOR • LanguageProcessor or Translator is a software that converts these programs into machine language • Every computer language has its own translators • Different Types of language processors are as follows: 1. Compiler 2. Interpreter 3. Assembler
  • 14.
    LANGUAGE PROCESSOR 1. Compiler •Coverts the instruction of high level language into machine language as a Whole. • Compiler converts source program into machine code known as object program. • Compiler checks each statement in the source program and generates machine instructions. • Compiler also checks syntax errors. • Source program containing error can not be compiled. • Compiler can translate the program of only that language in which it is written.
  • 15.
    Source Program ObjectProgram COMPILER
  • 16.
    LANGUAGE PROCESSOR 2. Interpreter •Converts one statement of a program at one time. • It execute the statement before translating the next statement of source program • If there is an error in the statement compiler stops working and display error message. • Programmer can correct error during program development. • Visual Basics use Interpreter
  • 17.
    LANGUAGE PROCESSOR 3. Assembler •Translating Program • Translates the instruction of assembly language into Machine Language. Assembly Language Program Object Program ASSENMBLER
  • 18.
    TASK 1. Difference betweenLow level languages and High level languages. (4 to 5) 2. Difference between Procedural and NON-Procedural Language. (3 to 4)