CSE202
OBJECT ORIENTED
Programming
LPU:: CSE202: OBJECT ORIENTED
Course Details
• L T P
[Five Hours/week]
3 0 2
• Text Book
“OBJECT ORIENTED
PROGRAMMING IN C++”
by
Robert Lafore
LPU:: CSE202: OBJECT ORIENTED
Reference Books
• PROGRAMMING WITH C++
by
D RAVICHANDRAN
• OBJECT ORIENTED
PROGRAMMING IN C++
by
E BALAGURUSAMY
LPU:: CSE202: OBJECT ORIENTED
Course Outcomes
CO1 :: identify basic programming constructs and use the
newly acquired skills to solve extensive programming
problems.
CO2 :: discuss the mechanism of code reusability by
creating own libraries of functions.
CO3 :: validate the logic building and code formulation by
designing code capable of passing various test cases.
CO4 :: interpret the principles of the object-oriented
model and apply it in the implementation in C++ language.
CO5 :: develop accurate, reliable and efficient software
applications.
CO6 :: apply the knowledge acquired to develop software
applications
LPU:: CSE202: OBJECT ORIENTED
Course Assessment Model
• CSE205 Marks break
up*
• Attendance 5
• Daily Practice Problems 20
• CA (Two best out of Three ATs)
30
• ETP (Practical /Laptop) 45
• Total 100
LPU:: CSE202: OBJECT ORIENTED
Academic Task
Component Week
1. Test 1 5th
2. Test 2 10th
3. Test 3 12th
LPU:: CSE202: OBJECT ORIENTED
CA
• Programming Practice using IamNeo
Platform 5
0
• Best 2 out of 3 Academic Task
• Programming practice is a compulsory
requirement
ETP
• Will be conducted on IamNeo Platform
LPU:: CSE202: OBJECT ORIENTED
Practice Problems
• In the Practice Problems marks are only for coding
Problems.
• MCQs are only for practice.
Sequence locking:
• Student must has completed all the problems of
lecture 1, to complete the problems of lecture 2.
LPU:: CSE202: OBJECT ORIENTED
Academic Task
1. Each Academic task will contain 2 coding
questions and 10 MCQs
2. The weightage of programming practice
which is spread across 150 problems with 25
problems per unit will be 20%.
LPU:: CSE202: OBJECT ORIENTED
Marks Calculation for Programming
Practice
• In order to qualify for programming practice marks,
the student must solve a minimum of 50% (75 Coding
Problems) problems (eligibility condition)
• No marks for MCQs.
Scoring Criteria:
I. If the student scores ≥ 81% in all CA's (best 2 out of
3), they will be eligible for 100% of the programming
practice marks.
II. If the student scores between 71% - 80% (inclusive)
in all CA's (best 2 out of 3), they will be eligible for
70% of the programming practice marks.
LPU:: CSE202: OBJECT ORIENTED
Marks Calculation for Programming
Practice
III. If the student scores between 51% - 70% (inclusive)
in all CA's (best 2 out of 3), they will be eligible for
50% of the programming practice marks.
IV. If the student scores between 30% - 50% (inclusive)
in all CA's (best 2 out of 3), they will be eligible for
30% of the programming practice marks.
V. If the student scores less than 30% in the CA's (best
2 out of 3), they will not be eligible for any benefit.
LPU:: CSE202: OBJECT ORIENTED
Daily Practice Problems
S. Unit Question Tentative Dates for
No Completion
1 Unit-1 27th August 2023
25 Multiple Choice
2 Unit-2 10th September 2023
Questions and 25
3 Unit-3 Practical 24th September 2023
Implementation
4 Unit-4 problems in each unit 22nd October 2023
5 Unit-5 5th November 2023
6 Unit-6 12th November 2023
Note:- Most Important for the improvement of
Performance in Course Assessments.
LPU:: CSE202: OBJECT ORIENTED
End Term Practical (45 Marks)
• Coding Problems [70%]
• Viva [30%]
LPU:: CSE202: OBJECT ORIENTED
Platform Used
• Live Demostration of IamNeo Platform
• URL: https://lpucolab438.examly.io/login
• UserName: [email protected]
• Password: Registration Number
LPU:: CSE202: OBJECT ORIENTED
Why a Star Course?
• This course Serves as the basis for the
product based pathways
• This course is a star course as it has
direct bearing with the placements.
LPU:: CSE202: OBJECT ORIENTED
The hitch……
Some burning questions in mind......
• Is C the only language behind the
development of all these powerful softwares
• Why C++?
• How C++ is different from C language?
• Is there no scope of this language in industry?
LPU:: CSE202: OBJECT ORIENTED
Flashback………..
What C language can do?????
• Device drivers are written in C language.
• All these modern programming languages are influenced by C
language
• Compilers for Python and PHP language are also written in C
language
• Embedded systems are also developed with the help of C
language
LPU:: CSE202: OBJECT ORIENTED
Is C only language?????
Lets answers your questions
No, C is not the only language for the
development of all these powerful system
If we talk about Windows operating system,
only Kernel is written in C language rest all
other features are provided with the help of
C++ language
LPU:: CSE202: OBJECT ORIENTED
How does it differ from C
C uses top down approach for problem solving
There are no means of providing security.
C doesn't support inheritance, makes it more
complex to use because everything has to be
written from scratch.
C is not able to represent real world modelling
LPU:: CSE202: OBJECT ORIENTED
No scope of language in
Industry
Top rated Companies which has a dearth of C++
programmers
LPU:: CSE202: OBJECT ORIENTED
Introduction to C++
In 1979, Bjarne Stroustrup, began work on "C with Classes”
The motivation for creating a new language originated from
Stroustrup's experience in programming for his Ph.D. thesis.
Stroustrup found that Simula had features
that were very helpful for large software
development, but the language was too
slow for practical use, while BCPL was fast but
too low-level to be suitable for large
software development.
LPU:: CSE202: OBJECT ORIENTED
Q1
Major objective for C++ is to:
A. Represent real world entities in the
form of objects
B. Implement procedural approach
C. Implement top down approach
D. Implement functional programming
LPU:: CSE202: OBJECT ORIENTED
Q2
Initial name of C++ was:
A. C++ with classes
B. C with classes
C. Objects with C++
D. C with objects
LPU:: CSE202: OBJECT ORIENTED
Applications
•Git
•Microsoft Excel
•Oracle Database
•MySql
•Linux
•Unix
•Android
•Google
LPU:: CSE202: OBJECT ORIENTED
• WHY C++?????
Lets see
LPU:: CSE202: OBJECT ORIENTED
Key features of C++
Object and Classes
Real world modelling
Encapsulation
Wrapping
Data Abstraction
Hiding of non required information
Inheritance
Reusability
LPU:: CSE202: OBJECT ORIENTED
Key features of C++
Polymorphism
Many forms
Data Hiding
Security
Message Passing
Communication
LPU:: CSE202: OBJECT ORIENTED
(Objects)Daily Analysis
Look around you and identify some
objects
Everything is an OBJECT
©LPU:: CSE202:
LPU :: CSE202 C++OBJECT ORIENTED
Programming
Object ,Object and Object
A student, a professor
A desk, a chair, a classroom, a
building
A university, a city, a country
A subject such as CS, Math, History,
…
©LPU:: CSE202:
LPU :: CSE202 C++OBJECT ORIENTED
Programming
Procedural Approach(C
Language)
• Focus is on procedures
• All data is shared: no protection
• More difficult to modify
• Hard to manage complexity
LPU:: CSE202: OBJECT ORIENTED
Data is not secure……..
FUNCTION 1
DATA 1
FUNCTION 2
DATA 2
FUNCTION 3
LPU:: CSE202: OBJECT ORIENTED
Object Oriented Approach
• Emphasis is on data rather than
procedure
• Programs are divided into what are
known as objects
• Data is hidden and cannot be accessed
by external functions
• New data and functions can be easily
added whenever necessary
LPU:: CSE202: OBJECT ORIENTED
DATA
MEMBER
FUNCTIONS
DATA
DATA
MEMBER
FUNCTIONS
MEMBER
FUNCTIONS
OBJECT ORIENTED APPROACHABSTRACTION &
ENCAPSULATION
LPU:: CSE202: OBJECT ORIENTED
Classes and Objects(Example
1)
LPU:: CSE202: OBJECT ORIENTED
Classes and Objects(Example
2)
LPU:: CSE202: OBJECT ORIENTED
Classes and Objects
• A class is a prototype or blueprint
for creating objects
• When we write a program in an
object-oriented languages like
C++,Java, we define classes,
which in turn are used to create
objects
36
LPU:: CSE202: OBJECT ORIENTED
Classes and Objects(Technical
class Example)
Time
inTime
hour Attributes:
hour = 8
minute minute = 30
Methods:
void addMinutes(int m)
void addMinutes( int m )
outTime
Attributes:
hour = 17
minute = 35
Methods:
void addMinutes(int m)
object
s
37
LPU:: CSE202: OBJECT ORIENTED
History of Object-Oriented
•
Programming
Started out for simulation of complex man
-machine systems, but was soon realized
that it was suitable for all complex
programming projects
• SIMULA I (1962-65) and Simula 67 (1967)
were the first two object-oriented
languages
–Developed at the Norwegian Computing Center,
Oslo, Norway by Ole-Johan Dahl and Kristen
Nygaard
–Simula 67 introduced most of the key concepts
of object-oriented programming: objects and
classes, subclasses (“inheritance”), virtual
procedures
38
LPU:: CSE202: OBJECT ORIENTED
The Ideas Spread
• Alan Kay, Adele Goldberg and colleagues at
Xerox PARC extend the ideas of Simula in
developing Smalltalk (1970’s)
• Bjarne Stroustrup develops C++ (1980’s) at
AT &T Bell Labs in Murray Hill, New Jersey,
USA
–Brings object oriented concepts into the C
programming language
–Earlier name was C with Classes
–Later in 1983 the name changed to C++(The
idea of ++ is taken from the increment operator
of C)
–In 1997, the ANSI/ISO made changes into the
language and it was standardised
39
LPU:: CSE202: OBJECT ORIENTED
Features Continued…
Encapsulation
Abstraction
Reusability
Inheritance
Polymorphism
LPU:: CSE202: OBJECT ORIENTED
Encapsulation
©LPU:: CSE202:
LPU :: CSE202 OBJECT
Object OrientedORIENTED
Programming
Abstraction(Hiding Details)
© LPU :: CSE202 C++ Programming
LPU:: CSE202: OBJECT ORIENTED
Reusability
Existing Features Existing Features + Additional
Features
© LPU :: CSE202 C++ Programming
LPU:: CSE202: OBJECT ORIENTED
Inheritance
But
Mummy,
where did
my blue
eyes come
from?
©LPU:: CSE202:
LPU :: CSE202 C++OBJECT ORIENTED
Programming
Inheritance….
LPU:: CSE202: OBJECT ORIENTED
Polymorphism
In front of father
In class
In CCD
One thing and many forms
©LPU:: CSE202:
LPU :: CSE202 C++OBJECT ORIENTED
Programming
Polymorphism
• Ability to appear in many forms…
LPU:: CSE202: OBJECT ORIENTED
Course Contents
•Classes and Objects •Operator Overloading
•Functions •Type Conversion
•Pointer •Inheritance
•Array •DMA
•String •Polymorphism
•Constructor and •Exception Handling
Destructor
•File Handling •Templates and STL
LPU:: CSE202: OBJECT ORIENTED