SlideShare a Scribd company logo
1 of 16
1
Programming
Languages &
Structure
University of Education Okara Campus
UniversityofEducationOkara
Campus
Part 2
2
The object-oriented paradigm
The object-oriented paradigm deals with active objects
instead of passive objects. We encounter many active
objects in our daily life: a vehicle, an automatic door, a
dishwasher and so on. The action to be performed on
these objects are included in the object: the objects need
only to receive the appropriate stimulus from outside to
perform one of the actions.
A file in an object-oriented paradigm can be
packed with all the procedures—called methods in the
object-oriented paradigm—to be performed by the file:
printing, copying, deleting and so on. The program in
this paradigm just sends the corresponding request to the
object.
UniversityofEducationOkara
Campus
3
Figure 5 The concept of an object-oriented paradigm
UniversityofEducationOkara
Campus
4
Classes
As Figure 9.5 shows, objects of the same type (files, for
example) need a set of methods that show how an object
of this type reacts to stimuli from outside the object’s
“territories”. To create these methods, a unit called a
class is used.
Figure 6 The concept of an object-oriented paradigm
UniversityofEducationOkara
Campus
5
Methods
In general, the format of methods are very similar to the
functions used in some procedural languages. Each
method has its header, its local variables and its
statement. This means that most of the features we
discussed for procedural languages are also applied to
methods written for an object-oriented program. In
other words, we can claim that object-oriented
languages are actually an extension of procedural
languages with some new ideas and some new features.
The C++ language, for example, is an object-oriented
extension of the C language.
UniversityofEducationOkara
Campus
6
Inheritance
In the object-oriented paradigm, as in nature, an object
can inherit from another object. This concept is called
inheritance. When a general class is defined, we can
define a more specific class that inherits some of the
characteristics of the general class, but also has some
new characteristics. For example, when an object of the
type GeometricalShapes is defined, we can define a class
called Rectangles. Rectangles are geometrical shapes
with additional characteristics.
UniversityofEducationOkara
Campus
7
Polymorphism
It means “many forms”. Polymorphism in the object-
oriented paradigm means that we can define several
operations with the same name that can do different
things in related classes. For example, assume that we
define two classes, Rectangles and Circles, both
inherited from the class GeometricalShapes. We define
two operations both named area, one in Rectangles and
one in Circles, that calculate the area of a rectangle or a
circle. The two operations have the same name
UniversityofEducationOkara
Campus
8
Some object-oriented languages
 C++
 Java
UniversityofEducationOkara
Campus
9.9
The functional paradigm
In the functional paradigm a program is considered a
mathematical function. In this context, a function is a
black box that maps a list of inputs to a list of outputs.
Figure 7 A function in a functional language
UniversityofEducationOkara
Campus
10
For example, we can define a primitive function
called first that extracts the first element of a list. It may
also have a function called rest that extracts all the
elements except the first. A program can define a
function that extracts the third element of a list by
combining these two functions as shown in Figure 9.8.
Figure 8 Extracting the third element of a list
UniversityofEducationOkara
Campus
11
Some functional languages
 LISP (LISt Programming)
 Scheme
UniversityofEducationOkara
Campus
12
The declarative paradigm
A declarative paradigm uses the principle of logical
reasoning to answer queries. It is based on formal logic
defined by Greek mathematicians and later developed
into
first-order predicate calculus.
Logical reasoning is based on deduction. Some
statements (facts) are given that are assumed to be true,
and the logician uses solid rules of logical reasoning to
deduce new statements (facts). For example, the famous
rule of deduction in logic is:
UniversityofEducationOkara
Campus
13
Using this rule and the two following facts,
we can deduce a new fact:
UniversityofEducationOkara
Campus
14
Prolog
One of the famous declarative languages is Prolog
(PROgramming in LOGic), developed by A.
Colmerauer in France in 1972. A program in Prolog is
made up of facts and rules. For example, the previous
facts about human beings can be stated as:
The user can then ask:
and the program will respond with yes.
UniversityofEducationOkara
Campus
15
9-4 COMMON CONCEPTS
In this section we conduct a quick navigation through
some procedural languages to find common concepts.
Some of these concepts are also available in most
object-oriented languages because, as we explained, an
object-oriented paradigm uses the procedural
paradigm when creating methods.
UniversityofEducationOkara
Campus
16
Identifiers
One feature present in all procedural languages, as well
as in other languages, is the identifier—that is, the name
of objects. Identifiers allow us to name objects in the
program. For example, each piece of data in a computer
is stored at a unique address. If there were no identifiers
to represent data locations symbolically, we would have
to know and use data addresses to manipulate them.
Instead, we simply give data names and let the compiler
keep track of where they are physically located.
UniversityofEducationOkara
Campus

More Related Content

What's hot

Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionRai University
 
Language design and translation issues
Language design and translation issuesLanguage design and translation issues
Language design and translation issuesSURBHI SAROHA
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programmingHaris Bin Zahid
 
Principles of object oriented programming
Principles of object oriented programmingPrinciples of object oriented programming
Principles of object oriented programmingAmogh Kalyanshetti
 
Principal of objected oriented programming
Principal of objected oriented programming Principal of objected oriented programming
Principal of objected oriented programming Rokonuzzaman Rony
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented languagefarhan amjad
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented TechnologiesUmesh Nikam
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - IntroductionMadishetty Prathibha
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented ProgrammingIqra khalil
 
POP vs OOP Introduction
POP vs OOP IntroductionPOP vs OOP Introduction
POP vs OOP IntroductionHashni T
 
diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...nihar joshi
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Languagedheva B
 

What's hot (20)

Lect 1
Lect 1Lect 1
Lect 1
 
Introduction to programming languages part 2
Introduction to programming languages   part 2Introduction to programming languages   part 2
Introduction to programming languages part 2
 
Bca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroductionBca 2nd sem u-1 iintroduction
Bca 2nd sem u-1 iintroduction
 
Introduction to c++ ppt 1
Introduction to c++ ppt 1Introduction to c++ ppt 1
Introduction to c++ ppt 1
 
Language design and translation issues
Language design and translation issuesLanguage design and translation issues
Language design and translation issues
 
Procedural vs. object oriented programming
Procedural vs. object oriented programmingProcedural vs. object oriented programming
Procedural vs. object oriented programming
 
Principles of object oriented programming
Principles of object oriented programmingPrinciples of object oriented programming
Principles of object oriented programming
 
Principal of objected oriented programming
Principal of objected oriented programming Principal of objected oriented programming
Principal of objected oriented programming
 
Presentation c
Presentation cPresentation c
Presentation c
 
Introduction to object oriented language
Introduction to object oriented languageIntroduction to object oriented language
Introduction to object oriented language
 
Object Oriented Technologies
Object Oriented TechnologiesObject Oriented Technologies
Object Oriented Technologies
 
Object Oriented programming - Introduction
Object Oriented programming - IntroductionObject Oriented programming - Introduction
Object Oriented programming - Introduction
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
Ak procedural vs oop
Ak procedural vs oopAk procedural vs oop
Ak procedural vs oop
 
POP vs OOP Introduction
POP vs OOP IntroductionPOP vs OOP Introduction
POP vs OOP Introduction
 
diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...diffrence between procedure oriented programming & object oriented programmin...
diffrence between procedure oriented programming & object oriented programmin...
 
Compare between pop and oop
Compare between pop and oopCompare between pop and oop
Compare between pop and oop
 
Programming paradigms
Programming paradigmsProgramming paradigms
Programming paradigms
 
Oop
OopOop
Oop
 
Object Oriented Language
Object Oriented LanguageObject Oriented Language
Object Oriented Language
 

Viewers also liked

Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceRk King
 
Concurrency in java
Concurrency in javaConcurrency in java
Concurrency in javaAbhra Basak
 
编程语言的历史
编程语言的历史编程语言的历史
编程语言的历史bradcao2010
 
09 implementing+subprograms
09 implementing+subprograms09 implementing+subprograms
09 implementing+subprogramsbaran19901990
 
Parallel Programming In Modern World .NET Technics
Parallel Programming In Modern World .NET TechnicsParallel Programming In Modern World .NET Technics
Parallel Programming In Modern World .NET TechnicsIT Weekend
 
Legend of Java Concurrency/Parallelism
Legend of Java Concurrency/ParallelismLegend of Java Concurrency/Parallelism
Legend of Java Concurrency/ParallelismYuichi Sakuraba
 
Programming language
Programming languageProgramming language
Programming languageLia Safitri
 
Programing language
Programing languagePrograming language
Programing languageJames Taylor
 
SD & D Types of programming language
SD & D Types of programming languageSD & D Types of programming language
SD & D Types of programming languageForrester High School
 
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...Gerke Max Preussner
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming ParadigmsDirecti Group
 
Modeling and abstraction, software development process [Software Modeling] [C...
Modeling and abstraction, software development process [Software Modeling] [C...Modeling and abstraction, software development process [Software Modeling] [C...
Modeling and abstraction, software development process [Software Modeling] [C...Ivano Malavolta
 

Viewers also liked (20)

Programing Language
Programing LanguagePrograming Language
Programing Language
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Concurrency in java
Concurrency in javaConcurrency in java
Concurrency in java
 
编程语言的历史
编程语言的历史编程语言的历史
编程语言的历史
 
09 implementing+subprograms
09 implementing+subprograms09 implementing+subprograms
09 implementing+subprograms
 
Parallel Programming In Modern World .NET Technics
Parallel Programming In Modern World .NET TechnicsParallel Programming In Modern World .NET Technics
Parallel Programming In Modern World .NET Technics
 
08 subprograms
08 subprograms08 subprograms
08 subprograms
 
Introduction to programing languages part 1
Introduction to programing languages   part 1Introduction to programing languages   part 1
Introduction to programing languages part 1
 
295 - Abstraction
295 - Abstraction295 - Abstraction
295 - Abstraction
 
Sample Slides 2
Sample Slides 2Sample Slides 2
Sample Slides 2
 
Legend of Java Concurrency/Parallelism
Legend of Java Concurrency/ParallelismLegend of Java Concurrency/Parallelism
Legend of Java Concurrency/Parallelism
 
Programming language
Programming languageProgramming language
Programming language
 
Programing language
Programing languagePrograming language
Programing language
 
SD & D Types of programming language
SD & D Types of programming languageSD & D Types of programming language
SD & D Types of programming language
 
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
East Coast DevCon 2014: Concurrency & Parallelism in UE4 - Tips for programmi...
 
SD & D High and low level languages
SD & D High and low level languagesSD & D High and low level languages
SD & D High and low level languages
 
Abstraction
AbstractionAbstraction
Abstraction
 
Introduction to Prolog
Introduction to PrologIntroduction to Prolog
Introduction to Prolog
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
Modeling and abstraction, software development process [Software Modeling] [C...
Modeling and abstraction, software development process [Software Modeling] [C...Modeling and abstraction, software development process [Software Modeling] [C...
Modeling and abstraction, software development process [Software Modeling] [C...
 

Similar to Introduction to programing languages part 2

Paradigms.pptx
Paradigms.pptxParadigms.pptx
Paradigms.pptxaikomo1
 
Ooad notes
Ooad notesOoad notes
Ooad notesNancyJP
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming ConceptsSanmatiRM
 
JAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxJAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxayankamila005
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaMadishetty Prathibha
 
Object Oriented Approach Within Siebel Boundaries
Object Oriented Approach Within Siebel BoundariesObject Oriented Approach Within Siebel Boundaries
Object Oriented Approach Within Siebel BoundariesRoman Agaev
 
Online learning in the age of scorm
Online learning in the age of scormOnline learning in the age of scorm
Online learning in the age of scormMurilo Haddad
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering conceptsKomal Singh
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Techglyphs
 
Mc0083 object oriented analysis & design using uml
Mc0083 object oriented analysis & design using umlMc0083 object oriented analysis & design using uml
Mc0083 object oriented analysis & design using umlsmumbahelp
 
Basics of object oriented programming
Basics of object oriented programmingBasics of object oriented programming
Basics of object oriented programmingNitin Kumar Kashyap
 

Similar to Introduction to programing languages part 2 (20)

Paradigms.pptx
Paradigms.pptxParadigms.pptx
Paradigms.pptx
 
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptxOBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
OBJECT ORIENTED PROGRAMMING CONCEPTS IN C++.pptx
 
Ooad notes
Ooad notesOoad notes
Ooad notes
 
Oop in java.pptx
Oop in java.pptxOop in java.pptx
Oop in java.pptx
 
General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]General OOP concept [by-Digvijay]
General OOP concept [by-Digvijay]
 
OOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptxOOSD1-unit1_1_16_09.pptx
OOSD1-unit1_1_16_09.pptx
 
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
CS3391 -OOP -UNIT – I  NOTES FINAL.pdfCS3391 -OOP -UNIT – I  NOTES FINAL.pdf
CS3391 -OOP -UNIT – I NOTES FINAL.pdf
 
Object Oriented Programming Concepts
Object Oriented Programming ConceptsObject Oriented Programming Concepts
Object Oriented Programming Concepts
 
JAVA - Oops Concept.pptx
JAVA - Oops Concept.pptxJAVA - Oops Concept.pptx
JAVA - Oops Concept.pptx
 
C++ & VISUAL C++
C++ & VISUAL C++ C++ & VISUAL C++
C++ & VISUAL C++
 
Oops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in JavaOops concepts || Object Oriented Programming Concepts in Java
Oops concepts || Object Oriented Programming Concepts in Java
 
Object Oriented Approach Within Siebel Boundaries
Object Oriented Approach Within Siebel BoundariesObject Oriented Approach Within Siebel Boundaries
Object Oriented Approach Within Siebel Boundaries
 
Online learning in the age of scorm
Online learning in the age of scormOnline learning in the age of scorm
Online learning in the age of scorm
 
Oops
OopsOops
Oops
 
Template abstrak & full paper seminar 50 thn
Template abstrak & full paper seminar 50 thnTemplate abstrak & full paper seminar 50 thn
Template abstrak & full paper seminar 50 thn
 
Object oriented software engineering concepts
Object oriented software engineering conceptsObject oriented software engineering concepts
Object oriented software engineering concepts
 
Bt8901 objective oriented systems1
Bt8901 objective oriented systems1Bt8901 objective oriented systems1
Bt8901 objective oriented systems1
 
Unit-V.pptx
Unit-V.pptxUnit-V.pptx
Unit-V.pptx
 
Mc0083 object oriented analysis & design using uml
Mc0083 object oriented analysis & design using umlMc0083 object oriented analysis & design using uml
Mc0083 object oriented analysis & design using uml
 
Basics of object oriented programming
Basics of object oriented programmingBasics of object oriented programming
Basics of object oriented programming
 

More from university of education,Lahore

More from university of education,Lahore (20)

Activites and Time Planning
 Activites and Time Planning Activites and Time Planning
Activites and Time Planning
 
Steganography
SteganographySteganography
Steganography
 
Classical Encryption Techniques
Classical Encryption TechniquesClassical Encryption Techniques
Classical Encryption Techniques
 
Activites and Time Planning
Activites and Time PlanningActivites and Time Planning
Activites and Time Planning
 
OSI Security Architecture
OSI Security ArchitectureOSI Security Architecture
OSI Security Architecture
 
Network Security Terminologies
Network Security TerminologiesNetwork Security Terminologies
Network Security Terminologies
 
Project Scheduling, Planning and Risk Management
Project Scheduling, Planning and Risk ManagementProject Scheduling, Planning and Risk Management
Project Scheduling, Planning and Risk Management
 
Software Testing and Debugging
Software Testing and DebuggingSoftware Testing and Debugging
Software Testing and Debugging
 
ePayment Methods
ePayment MethodsePayment Methods
ePayment Methods
 
SEO
SEOSEO
SEO
 
A Star Search
A Star SearchA Star Search
A Star Search
 
Enterprise Application Integration
Enterprise Application IntegrationEnterprise Application Integration
Enterprise Application Integration
 
Uml Diagrams
Uml DiagramsUml Diagrams
Uml Diagrams
 
eDras Max
eDras MaxeDras Max
eDras Max
 
RAD Model
RAD ModelRAD Model
RAD Model
 
Microsoft Project
Microsoft ProjectMicrosoft Project
Microsoft Project
 
Itertaive Process Development
Itertaive Process DevelopmentItertaive Process Development
Itertaive Process Development
 
Computer Aided Software Engineering Nayab Awan
Computer Aided Software Engineering Nayab AwanComputer Aided Software Engineering Nayab Awan
Computer Aided Software Engineering Nayab Awan
 
Lect 2 assessing the technology landscape
Lect 2 assessing the technology landscapeLect 2 assessing the technology landscape
Lect 2 assessing the technology landscape
 
system level requirements gathering and analysis
system level requirements gathering and analysissystem level requirements gathering and analysis
system level requirements gathering and analysis
 

Recently uploaded

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...anjaliyadav012327
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 

Recently uploaded (20)

SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
JAPAN: ORGANISATION OF PMDA, PHARMACEUTICAL LAWS & REGULATIONS, TYPES OF REGI...
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 

Introduction to programing languages part 2

  • 1. 1 Programming Languages & Structure University of Education Okara Campus UniversityofEducationOkara Campus Part 2
  • 2. 2 The object-oriented paradigm The object-oriented paradigm deals with active objects instead of passive objects. We encounter many active objects in our daily life: a vehicle, an automatic door, a dishwasher and so on. The action to be performed on these objects are included in the object: the objects need only to receive the appropriate stimulus from outside to perform one of the actions. A file in an object-oriented paradigm can be packed with all the procedures—called methods in the object-oriented paradigm—to be performed by the file: printing, copying, deleting and so on. The program in this paradigm just sends the corresponding request to the object. UniversityofEducationOkara Campus
  • 3. 3 Figure 5 The concept of an object-oriented paradigm UniversityofEducationOkara Campus
  • 4. 4 Classes As Figure 9.5 shows, objects of the same type (files, for example) need a set of methods that show how an object of this type reacts to stimuli from outside the object’s “territories”. To create these methods, a unit called a class is used. Figure 6 The concept of an object-oriented paradigm UniversityofEducationOkara Campus
  • 5. 5 Methods In general, the format of methods are very similar to the functions used in some procedural languages. Each method has its header, its local variables and its statement. This means that most of the features we discussed for procedural languages are also applied to methods written for an object-oriented program. In other words, we can claim that object-oriented languages are actually an extension of procedural languages with some new ideas and some new features. The C++ language, for example, is an object-oriented extension of the C language. UniversityofEducationOkara Campus
  • 6. 6 Inheritance In the object-oriented paradigm, as in nature, an object can inherit from another object. This concept is called inheritance. When a general class is defined, we can define a more specific class that inherits some of the characteristics of the general class, but also has some new characteristics. For example, when an object of the type GeometricalShapes is defined, we can define a class called Rectangles. Rectangles are geometrical shapes with additional characteristics. UniversityofEducationOkara Campus
  • 7. 7 Polymorphism It means “many forms”. Polymorphism in the object- oriented paradigm means that we can define several operations with the same name that can do different things in related classes. For example, assume that we define two classes, Rectangles and Circles, both inherited from the class GeometricalShapes. We define two operations both named area, one in Rectangles and one in Circles, that calculate the area of a rectangle or a circle. The two operations have the same name UniversityofEducationOkara Campus
  • 8. 8 Some object-oriented languages  C++  Java UniversityofEducationOkara Campus
  • 9. 9.9 The functional paradigm In the functional paradigm a program is considered a mathematical function. In this context, a function is a black box that maps a list of inputs to a list of outputs. Figure 7 A function in a functional language UniversityofEducationOkara Campus
  • 10. 10 For example, we can define a primitive function called first that extracts the first element of a list. It may also have a function called rest that extracts all the elements except the first. A program can define a function that extracts the third element of a list by combining these two functions as shown in Figure 9.8. Figure 8 Extracting the third element of a list UniversityofEducationOkara Campus
  • 11. 11 Some functional languages  LISP (LISt Programming)  Scheme UniversityofEducationOkara Campus
  • 12. 12 The declarative paradigm A declarative paradigm uses the principle of logical reasoning to answer queries. It is based on formal logic defined by Greek mathematicians and later developed into first-order predicate calculus. Logical reasoning is based on deduction. Some statements (facts) are given that are assumed to be true, and the logician uses solid rules of logical reasoning to deduce new statements (facts). For example, the famous rule of deduction in logic is: UniversityofEducationOkara Campus
  • 13. 13 Using this rule and the two following facts, we can deduce a new fact: UniversityofEducationOkara Campus
  • 14. 14 Prolog One of the famous declarative languages is Prolog (PROgramming in LOGic), developed by A. Colmerauer in France in 1972. A program in Prolog is made up of facts and rules. For example, the previous facts about human beings can be stated as: The user can then ask: and the program will respond with yes. UniversityofEducationOkara Campus
  • 15. 15 9-4 COMMON CONCEPTS In this section we conduct a quick navigation through some procedural languages to find common concepts. Some of these concepts are also available in most object-oriented languages because, as we explained, an object-oriented paradigm uses the procedural paradigm when creating methods. UniversityofEducationOkara Campus
  • 16. 16 Identifiers One feature present in all procedural languages, as well as in other languages, is the identifier—that is, the name of objects. Identifiers allow us to name objects in the program. For example, each piece of data in a computer is stored at a unique address. If there were no identifiers to represent data locations symbolically, we would have to know and use data addresses to manipulate them. Instead, we simply give data names and let the compiler keep track of where they are physically located. UniversityofEducationOkara Campus