SlideShare a Scribd company logo
1
Programming Languages &Programming Languages &
StructureStructure
University of Education Okara Campus
UniversityofEducationOkara
Campus
Part 1
2
Describe the evolution of programming languages from machineDescribe the evolution of programming languages from machine
language to high-level languages. Understand how a program inlanguage to high-level languages. Understand how a program in
a high-level language is translated into machine language.a high-level language is translated into machine language.
Distinguish between four computer language paradigms.Distinguish between four computer language paradigms.
Understand the procedural paradigm and the interaction betweenUnderstand the procedural paradigm and the interaction between
a program unit and data items in the paradigm. Understand thea program unit and data items in the paradigm. Understand the
object-oriented paradigm and the interaction between a programobject-oriented paradigm and the interaction between a program
unit and objects in this paradigm. Define functional paradigmunit and objects in this paradigm. Define functional paradigm
and understand its applications. Define a declaration paradigmand understand its applications. Define a declaration paradigm
and understand its applications. Define common concepts inand understand its applications. Define common concepts in
procedural and object-oriented languages.procedural and object-oriented languages.
ObjectivesObjectives
After studying this chapter, the student should be able to:After studying this chapter, the student should be able to:
UniversityofEducationOkara
Campus
3
9-1 EVOLUTION9-1 EVOLUTION
To write a program for a computer, we must use aTo write a program for a computer, we must use a
computer language. A computer language is a set ofcomputer language. A computer language is a set of
predefined words that are combined into a programpredefined words that are combined into a program
according to predefined rules (according to predefined rules (syntax). Over the years,). Over the years,
computer languages have evolved fromcomputer languages have evolved from machine
language toto high-level languages..
UniversityofEducationOkara
Campus
4
Machine languages
UniversityofEducationOkara
Campus
In the earliest days of computers, the only programming
languages available were machine languages. Each
computer had its own machine language, which was made of
streams of 0s and 1s. We need to use eleven lines of code to read
two integers, add them and print the result. These lines of code,
when written in machine language, make eleven lines of binary
code, each of 16 bits, as shown in Table 9.1.
The only language understood by a computer is machine language.The only language understood by a computer is machine language.
5
UniversityofEducationOkara
Campus
6
Assembly languages
The next evolution in programming came with the idea of
replacing binary code for instruction and addresses with symbols
or mnemonics. Because they used symbols, these languages were
first known as symbolic languages. The set of these mnemonic
languages were later referred to as assembly languages. The
assembly language for our hypothetical computer to replace the
machine language in Table 9.2 is shown in Program 9.1.
UniversityofEducationOkara
Campus
7
High-level languages
Although assembly languages greatly improved programming
efficiency, they still required programmers to concentrate on the
hardware they were using. Working with symbolic languages was
also very tedious, because each machine instruction had to be
individually coded. The desire to improve programmer efficiency
and to change the focus from the computer to the problem being
solved led to the development of high-level languages.
Over the years, various languages, most notably BASIC,
COBOL, Pascal, Ada, C, C++ and Java, were developed.
Program 9.1 shows the code for adding two integers as it would
appear in the C++ language.
UniversityofEducationOkara
Campus
8
UniversityofEducationOkara
Campus
C++ Program to add two numbers
#include<iostream.h>
#include<iostream.h>
Void main() {
Clrscr();
Int a=5, b=10;
Int c = a+b;
Cout<<c;
Getch();
}
9
9-2 TRANSLATION9-2 TRANSLATION
Programs today are normally written in one of thePrograms today are normally written in one of the
high-level languages. To run the program on ahigh-level languages. To run the program on a
computer, the program needs to be translated into thecomputer, the program needs to be translated into the
machine language of the computer on which it will run.machine language of the computer on which it will run.
The program in a high-level language is called theThe program in a high-level language is called the
source program. The translated program in machinesource program. The translated program in machine
language is called the object program. Two methodslanguage is called the object program. Two methods
are used for translation:are used for translation: compilation andand
interpretation..
UniversityofEducationOkara
Campus
10
Compilation
A compiler normally translates the whole source
program into the object program.
Interpretation
Some computer languages use an interpreter to translate
the source program into the object program.
Interpretation refers to the process of translating each
line of the source program into the corresponding line of
the object program and executing the line. However, we
need to be aware of two trends in interpretation: that is
used by some languages before Java and the
interpretation used by Java.
UniversityofEducationOkara
Campus
11
Translation process
Compilation and interpretation differ in that the first
translates the whole source code before executing it,
while the second translates and executes the source code a
line at a time. Both methods, however, follow the same
translation process shown in Figure 9.1.
Figure 1 Source code translation process
UniversityofEducationOkara
Campus
12
9-3 PROGRAMMING PARADIGMS9-3 PROGRAMMING PARADIGMS
Today, computer languages are categorized according toToday, computer languages are categorized according to
the approach they use to solve a problem. Athe approach they use to solve a problem. A
paradigm, therefore, is a way in which a computer, therefore, is a way in which a computer
language looks at the problem to be solved. We dividelanguage looks at the problem to be solved. We divide
computer languages into four paradigms:computer languages into four paradigms: proceduralprocedural,,
object-orientedobject-oriented,, functionalfunctional andand declarativedeclarative. Figure 9.2. Figure 9.2
summarizes these.summarizes these.
UniversityofEducationOkara
Campus
13
Figure 2 Categories of programming languages
UniversityofEducationOkara
Campus
14
The Procedural Language
A program in a procedural paradigm is an active agentA program in a procedural paradigm is an active agent
that uses passive objects that we refer to as data or datathat uses passive objects that we refer to as data or data
items. To manipulate a piece of data, the active agentitems. To manipulate a piece of data, the active agent
(program) issues an action, referred to as a procedure.(program) issues an action, referred to as a procedure.
For example, think of a program that prints the contentsFor example, think of a program that prints the contents
of a file. The file is a passive object. To print the file, theof a file. The file is a passive object. To print the file, the
program uses a procedure, which we call print.program uses a procedure, which we call print.
Derived from Structured Programming.Derived from Structured Programming.
UniversityofEducationOkara
Campus
Procedural Object-oriented
procedure method
record object
module class
procedure call message
15
Figure 3 The concept of the procedural paradigm
UniversityofEducationOkara
Campus
16
A program in this paradigm is made up of three parts: a
part for object creation, a set of procedure calls and a
set of code for each procedure. Some procedures have
already been defined in the language itself. By
combining this code, the programmer can create new
procedures.
Figure 4 The components of a procedural program
UniversityofEducationOkara
Campus
17
Some procedural languages
 FORTRAN (FORmula TRANslation)
 COBOL (COmmon Business-Oriented Language)
 Pascal
 C
 Ada
UniversityofEducationOkara
Campus

More Related Content

PPT
Introduction to programming languages part 1
PPT
Programming language
PPT
13 A Programing Languages (IT) Lecture Slide
PPT
Programming Languages An Intro
PPT
Introduction to programing languages part 2
PPT
Introduction to programing languages part 3
PPTX
Imperative programming
PDF
Programing paradigm &amp; implementation
Introduction to programming languages part 1
Programming language
13 A Programing Languages (IT) Lecture Slide
Programming Languages An Intro
Introduction to programing languages part 2
Introduction to programing languages part 3
Imperative programming
Programing paradigm &amp; implementation

What's hot (20)

PDF
Object oriented concepts ppt
PPTX
Programming Fundamentals lecture 2
PPT
SD & D Types of programming language
PPT
Lect 1. introduction to programming languages
PPT
PROGRAMMING LANGUAGES
PDF
Programming languages and concepts by vivek parihar
PPTX
Programming Fundamentals lecture 1
PPSX
Programming Fundamental Presentation
PPTX
Basic programming concepts
PDF
Introduction to compilers
PPTX
Programming landuages
PPTX
Cmp2412 programming principles
PPTX
Programming Language
PDF
Introduction to c++ ppt 1
PPTX
Ndu06 typesof language
PDF
Problem solving methodology
PPTX
Introduction To Computer Programming
PPTX
Programming Languages
PDF
Principles of-programming-languages-lecture-notes-
PPT
Introduction to c_language
Object oriented concepts ppt
Programming Fundamentals lecture 2
SD & D Types of programming language
Lect 1. introduction to programming languages
PROGRAMMING LANGUAGES
Programming languages and concepts by vivek parihar
Programming Fundamentals lecture 1
Programming Fundamental Presentation
Basic programming concepts
Introduction to compilers
Programming landuages
Cmp2412 programming principles
Programming Language
Introduction to c++ ppt 1
Ndu06 typesof language
Problem solving methodology
Introduction To Computer Programming
Programming Languages
Principles of-programming-languages-lecture-notes-
Introduction to c_language
Ad

Viewers also liked (20)

PDF
Programing language
PPTX
program development and paradigms
PDF
Introduction of Functional Programming
PPTX
Programming languages ms harsha
PPT
Programing Language
PPT
programing laugauge
DOCX
Glosario de-términos-especificos-utilizados-en-la-red-5-oct-16
PPTX
Go programing language
PPTX
Futuristic programing language
PPTX
Functional Programing
PDF
Describe professional programing languages and talks
PPT
Intro To Programming Concepts
PDF
Intro to functional programming
PPT
Programming fundamentals lecture 1&2
PPTX
Introduction of c programming
PPT
Generations Of Programming Languages
PPTX
Programming Paradigm & Languages
PDF
Introduction to computer programming
PPTX
Class 1
PPTX
Prep velvet – Speed Maths
Programing language
program development and paradigms
Introduction of Functional Programming
Programming languages ms harsha
Programing Language
programing laugauge
Glosario de-términos-especificos-utilizados-en-la-red-5-oct-16
Go programing language
Futuristic programing language
Functional Programing
Describe professional programing languages and talks
Intro To Programming Concepts
Intro to functional programming
Programming fundamentals lecture 1&2
Introduction of c programming
Generations Of Programming Languages
Programming Paradigm & Languages
Introduction to computer programming
Class 1
Prep velvet – Speed Maths
Ad

Similar to Introduction to programing languages part 1 (20)

PPTX
PROGRAMMING, the presentation is about,,
PPTX
Introduction to Programming Concepts By Aamir Saleem Ansari
PPTX
week 2 - INTRO TO PROGRAMMING.pptx
PPTX
Plc part 1
PPTX
Define Computer language, Translator, Standard input out C
PPT
PDF
Chapter-1-1 object oriented programing pdf.pdf
PPT
Introduction to Computer
PPTX
High Level Language (HLL)
PPTX
PPL_Unit01 for the insem study first year.pptx
PDF
Programming Languages Lectures Slides Oscar Nierstrasz
PPTX
computer programming computer programmin
PPTX
java programming for students UNIT 1.pptx
PPTX
Introduction_to_Programming.pptx
PDF
2 Programming Language.pdf
PPTX
Advanced Programming practices - UNIT 1 .pptx
PPTX
Programming Paradigm & Languages
PPTX
Introduction to programming c
PDF
Introduction to programming language (basic)
PROGRAMMING, the presentation is about,,
Introduction to Programming Concepts By Aamir Saleem Ansari
week 2 - INTRO TO PROGRAMMING.pptx
Plc part 1
Define Computer language, Translator, Standard input out C
Chapter-1-1 object oriented programing pdf.pdf
Introduction to Computer
High Level Language (HLL)
PPL_Unit01 for the insem study first year.pptx
Programming Languages Lectures Slides Oscar Nierstrasz
computer programming computer programmin
java programming for students UNIT 1.pptx
Introduction_to_Programming.pptx
2 Programming Language.pdf
Advanced Programming practices - UNIT 1 .pptx
Programming Paradigm & Languages
Introduction to programming c
Introduction to programming language (basic)

More from university of education,Lahore (20)

PPT
Activites and Time Planning
PPT
Classical Encryption Techniques
PPT
Activites and Time Planning
PPTX
OSI Security Architecture
PPTX
Network Security Terminologies
PPT
Project Scheduling, Planning and Risk Management
PPTX
Software Testing and Debugging
PPTX
PPT
Enterprise Application Integration
PPTX
PPTX
Itertaive Process Development
PPTX
Computer Aided Software Engineering Nayab Awan
PPTX
Lect 2 assessing the technology landscape
PPTX
system level requirements gathering and analysis
Activites and Time Planning
Classical Encryption Techniques
Activites and Time Planning
OSI Security Architecture
Network Security Terminologies
Project Scheduling, Planning and Risk Management
Software Testing and Debugging
Enterprise Application Integration
Itertaive Process Development
Computer Aided Software Engineering Nayab Awan
Lect 2 assessing the technology landscape
system level requirements gathering and analysis

Recently uploaded (20)

PPTX
GDM (1) (1).pptx small presentation for students
PDF
Microbial disease of the cardiovascular and lymphatic systems
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
Computing-Curriculum for Schools in Ghana
PPTX
Presentation on HIE in infants and its manifestations
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
01-Introduction-to-Information-Management.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Institutional Correction lecture only . . .
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
Final Presentation General Medicine 03-08-2024.pptx
GDM (1) (1).pptx small presentation for students
Microbial disease of the cardiovascular and lymphatic systems
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
O5-L3 Freight Transport Ops (International) V1.pdf
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Computing-Curriculum for Schools in Ghana
Presentation on HIE in infants and its manifestations
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
01-Introduction-to-Information-Management.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Module 4: Burden of Disease Tutorial Slides S2 2025
Anesthesia in Laparoscopic Surgery in India
2.FourierTransform-ShortQuestionswithAnswers.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
human mycosis Human fungal infections are called human mycosis..pptx
Institutional Correction lecture only . . .
Complications of Minimal Access Surgery at WLH
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Microbial diseases, their pathogenesis and prophylaxis
Final Presentation General Medicine 03-08-2024.pptx

Introduction to programing languages part 1

  • 1. 1 Programming Languages &Programming Languages & StructureStructure University of Education Okara Campus UniversityofEducationOkara Campus Part 1
  • 2. 2 Describe the evolution of programming languages from machineDescribe the evolution of programming languages from machine language to high-level languages. Understand how a program inlanguage to high-level languages. Understand how a program in a high-level language is translated into machine language.a high-level language is translated into machine language. Distinguish between four computer language paradigms.Distinguish between four computer language paradigms. Understand the procedural paradigm and the interaction betweenUnderstand the procedural paradigm and the interaction between a program unit and data items in the paradigm. Understand thea program unit and data items in the paradigm. Understand the object-oriented paradigm and the interaction between a programobject-oriented paradigm and the interaction between a program unit and objects in this paradigm. Define functional paradigmunit and objects in this paradigm. Define functional paradigm and understand its applications. Define a declaration paradigmand understand its applications. Define a declaration paradigm and understand its applications. Define common concepts inand understand its applications. Define common concepts in procedural and object-oriented languages.procedural and object-oriented languages. ObjectivesObjectives After studying this chapter, the student should be able to:After studying this chapter, the student should be able to: UniversityofEducationOkara Campus
  • 3. 3 9-1 EVOLUTION9-1 EVOLUTION To write a program for a computer, we must use aTo write a program for a computer, we must use a computer language. A computer language is a set ofcomputer language. A computer language is a set of predefined words that are combined into a programpredefined words that are combined into a program according to predefined rules (according to predefined rules (syntax). Over the years,). Over the years, computer languages have evolved fromcomputer languages have evolved from machine language toto high-level languages.. UniversityofEducationOkara Campus
  • 4. 4 Machine languages UniversityofEducationOkara Campus In the earliest days of computers, the only programming languages available were machine languages. Each computer had its own machine language, which was made of streams of 0s and 1s. We need to use eleven lines of code to read two integers, add them and print the result. These lines of code, when written in machine language, make eleven lines of binary code, each of 16 bits, as shown in Table 9.1. The only language understood by a computer is machine language.The only language understood by a computer is machine language.
  • 6. 6 Assembly languages The next evolution in programming came with the idea of replacing binary code for instruction and addresses with symbols or mnemonics. Because they used symbols, these languages were first known as symbolic languages. The set of these mnemonic languages were later referred to as assembly languages. The assembly language for our hypothetical computer to replace the machine language in Table 9.2 is shown in Program 9.1. UniversityofEducationOkara Campus
  • 7. 7 High-level languages Although assembly languages greatly improved programming efficiency, they still required programmers to concentrate on the hardware they were using. Working with symbolic languages was also very tedious, because each machine instruction had to be individually coded. The desire to improve programmer efficiency and to change the focus from the computer to the problem being solved led to the development of high-level languages. Over the years, various languages, most notably BASIC, COBOL, Pascal, Ada, C, C++ and Java, were developed. Program 9.1 shows the code for adding two integers as it would appear in the C++ language. UniversityofEducationOkara Campus
  • 8. 8 UniversityofEducationOkara Campus C++ Program to add two numbers #include<iostream.h> #include<iostream.h> Void main() { Clrscr(); Int a=5, b=10; Int c = a+b; Cout<<c; Getch(); }
  • 9. 9 9-2 TRANSLATION9-2 TRANSLATION Programs today are normally written in one of thePrograms today are normally written in one of the high-level languages. To run the program on ahigh-level languages. To run the program on a computer, the program needs to be translated into thecomputer, the program needs to be translated into the machine language of the computer on which it will run.machine language of the computer on which it will run. The program in a high-level language is called theThe program in a high-level language is called the source program. The translated program in machinesource program. The translated program in machine language is called the object program. Two methodslanguage is called the object program. Two methods are used for translation:are used for translation: compilation andand interpretation.. UniversityofEducationOkara Campus
  • 10. 10 Compilation A compiler normally translates the whole source program into the object program. Interpretation Some computer languages use an interpreter to translate the source program into the object program. Interpretation refers to the process of translating each line of the source program into the corresponding line of the object program and executing the line. However, we need to be aware of two trends in interpretation: that is used by some languages before Java and the interpretation used by Java. UniversityofEducationOkara Campus
  • 11. 11 Translation process Compilation and interpretation differ in that the first translates the whole source code before executing it, while the second translates and executes the source code a line at a time. Both methods, however, follow the same translation process shown in Figure 9.1. Figure 1 Source code translation process UniversityofEducationOkara Campus
  • 12. 12 9-3 PROGRAMMING PARADIGMS9-3 PROGRAMMING PARADIGMS Today, computer languages are categorized according toToday, computer languages are categorized according to the approach they use to solve a problem. Athe approach they use to solve a problem. A paradigm, therefore, is a way in which a computer, therefore, is a way in which a computer language looks at the problem to be solved. We dividelanguage looks at the problem to be solved. We divide computer languages into four paradigms:computer languages into four paradigms: proceduralprocedural,, object-orientedobject-oriented,, functionalfunctional andand declarativedeclarative. Figure 9.2. Figure 9.2 summarizes these.summarizes these. UniversityofEducationOkara Campus
  • 13. 13 Figure 2 Categories of programming languages UniversityofEducationOkara Campus
  • 14. 14 The Procedural Language A program in a procedural paradigm is an active agentA program in a procedural paradigm is an active agent that uses passive objects that we refer to as data or datathat uses passive objects that we refer to as data or data items. To manipulate a piece of data, the active agentitems. To manipulate a piece of data, the active agent (program) issues an action, referred to as a procedure.(program) issues an action, referred to as a procedure. For example, think of a program that prints the contentsFor example, think of a program that prints the contents of a file. The file is a passive object. To print the file, theof a file. The file is a passive object. To print the file, the program uses a procedure, which we call print.program uses a procedure, which we call print. Derived from Structured Programming.Derived from Structured Programming. UniversityofEducationOkara Campus Procedural Object-oriented procedure method record object module class procedure call message
  • 15. 15 Figure 3 The concept of the procedural paradigm UniversityofEducationOkara Campus
  • 16. 16 A program in this paradigm is made up of three parts: a part for object creation, a set of procedure calls and a set of code for each procedure. Some procedures have already been defined in the language itself. By combining this code, the programmer can create new procedures. Figure 4 The components of a procedural program UniversityofEducationOkara Campus
  • 17. 17 Some procedural languages  FORTRAN (FORmula TRANslation)  COBOL (COmmon Business-Oriented Language)  Pascal  C  Ada UniversityofEducationOkara Campus