Paper Code: Paper Name: OOP With C++ Lesson No: 1 Lesson Name: Introduction of OOP Author: Pooja Chawla Vetter: Prof. Dharminder Kumar
Paper Code: Paper Name: OOP With C++ Lesson No: 1 Lesson Name: Introduction of OOP Author: Pooja Chawla Vetter: Prof. Dharminder Kumar
Paper Code: Paper Name: OOP With C++ Lesson No: 1 Lesson Name: Introduction of OOP Author: Pooja Chawla Vetter: Prof. Dharminder Kumar
Unit Structure:
1.1 Software crisis
1.2 Software Evaluation
1.3 POP (Procedure Oriented Programming)
1.4 OOP (Object Oriented Programming)
1.5 Basic concepts of OOP
1.5.1 Objects
1.5.2 Classes
1.5.3 Data Abstraction and Data Encapsulation
1.5.4 Inheritance
1.5.5 Polymorphism
1.5.6 Dynamic Binding
1.5.7 Message Passing
1.6 Benefits of OOP
1.7 Object Oriented Language
1.8 Application of OOP
1.9 Introduction of C++
1.9.1 Application of C++
1.10 Simple C++ Program
1.10.1 Program Features
1.10.2 Comments
1.10.3 Output Operators
1.10.4 Iostream File
1.10.5 Namespace
1.10.6 Return Type of main ()
1.11 More C++ Statements
1.11.1 Variable
1.11.2 Input Operator
1.11.3 Cascading I/O Operator
1.12 Example with Class
1.13 Structure of C++
1.14 Creating Source File
1.15 Compiling and Linking
1.1 Software Crisis
Developments in software technology continue to be dynamic. New tools and techniques
are announced in quick succession. This has forced the software engineers and industry to
continuously look for new approaches to software design and development, and they are
becoming more and more critical in view of the increasing complexity of software
systems as well as the highly competitive nature of the industry. These rapid advances
appear to have created a situation of crisis within the industry. The following issued need
to be addressed to face the crisis:
• How to represent real-life entities of problems in system design?
• How to design system with open interfaces?
• How to ensure reusability and extensibility of modules?
• How to develop modules that are tolerant of any changes in future?
• How to improve software productivity and decrease software cost?
• How to improve the quality of software?
• How to manage time schedules?
1, 0
Machine Language
Assembly Language
Procedure- Oriented
With the advent of languages such as c, structured programming became very popular
and was the main technique of the 1980’s. Structured programming was a powerful tool
that enabled programmers to write moderately complex programs fairly easily. However,
as the programs grew larger, even the structured approach failed to show the desired
result in terms of bug-free, easy-to- maintain, and reusable programs.
Main Program
Function-4
Function-5
In a multi-function program, many important data items are placed as global so that
they may be accessed by all the functions. Each function may have its own local data.
Global data are more vulnerable to an inadvertent change by a function. In a large
program it is very difficult to identify what data is used by which function. In case we
need to revise an external data structure, we also need to revise all functions that access
the data. This provides an opportunity for bugs to creep in.
Another serious drawback with the procedural approach is that we do not model real
world problems very well. This is because functions are action-oriented and do not really
corresponding to the element of the problem.
DATA DATA
Communication
FUNCTION FUNCTION
Object
DATA
FUNCTION
Some of the features of object oriented programming are:
1.5.1 Objects
Objects are the basic run time entities in an object-oriented system. They may represent a
person, a place, a bank account, a table of data or any item that the program has to
handle. They may also represent user-defined data such as vectors, time and lists.
Programming problem is analyzed in term of objects and the nature of communication
between them. Program objects should be chosen such that they match closely with the
real-world objects. Objects take up space in the memory and have an associated address
like a record in Pascal, or a structure in c.
When a program is executed, the objects interact by sending messages to one another.
Foe example, if “customer” and “account” are to object in a program, then the customer
object may send a message to the count object requesting for the bank balance. Each
object contain data, and code to manipulate data. Objects can interact without having to
know details of each other’s data or code. It is a sufficient to know the type of message
accepted, and the type of response returned by the objects. Although different author