Expecting to get a good job without studying hard is like expecting to win a marathon without running it.
--Your friends at LectureNotes

Note for Object Oriented Programming Using Cpp - OOP By Umesh Kumar

  • Object Oriented Programming Using Cpp - OOP
  • Note
  • Guru Ghasidas Viswavidhyalaya - GGV
  • Master of Computer Applications
  • 5 Topics
  • 38 Offline Downloads
  • Uploaded 11 months ago
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1


Text from page-2

MCA-202 Object Oriented Programming with C++ Unit-I Principles of OOP:Procedure oriented Vs Object oriented, OOP paradigm, Features of OOP ,Basic Data types Tokens, Keywords, Constant ,Variables, Operator I/O statements , Structure of C++ program, Arrays, pointers, Object modeling technique (OMT). Unit-II Function, Object and Class: Defining class, Abstract class ,Function prototype, Function with parameter ,Passing object as a parameter, Constructor function ,Types of constructor, Destructor Friend function , Friend class, Dynamic allocation operator new and delete. Unit-III Polymorphism and Inheritance: Types of polymorphism, Constructor overloading, Operator overloading, Template function Template class, Types of inheritance ,Private ,protected and public derivation of class ,Resolving ambiguity Pointer to object, This pointer ,Virtual class , virtual function. Unit-IV Input - output and File handling: I/O classes ,File and stream classes ,Opening and closing file Detecting end of file, String I/O, Char I/O, Object I/O, I/O with multiple object ,File pointer, Disk I/O. Unit-V Exception handling, Name spaces and Standard Template library (STL): Need of Exception handling, try, catch and throws keywords, defining namespace ,benefit of namespace, Component of STL. By Mr. Umesh Kumar, MCA (GGU) Page | 2

Text from page-3

Unit-I Principles of OOP Introduction to C++  C++ was developed by Bjarne Stroustrup in 1979 at Bell Labs.  It is a general purpose programming language which supports procedural, objectoriented and generic programming.  The main purpose of C++ was to make writing good programs easier and more pleasant for the individual programmer.  It is a high-level programming language, but it includes many low-level facilities to manipulate the computer's memory.  It is the first Object-oriented programming language and most popular after C language.  C++ is a superset of C. Procedure oriented Vs Object oriented No. C C++ 1) C follows the procedural style programming. 2) Data is less secured in C. 3) 4) 5) 6) 7) C follows the top-down approach. C does not support function overloading. In C, you can't use functions in structure. C does not support reference variables. In C, scanf() and printf() are mainly used for input/output. Operator overloading is not possible in C. C programs are divided into procedures and modules C does not provide the feature of namespace. Exception handling is not easy in C. It has to perform using other functions. C++ is multi-paradigm. It supports both procedural and object oriented. In C++, you can use modifiers for class members to make it inaccessible for outside users. C++ follows the bottom-up approach. C++ supports function overloading. In C++, you can use functions in structure. C++ supports reference variables. C++ mainly uses stream cin and cout to perform input and output operations. Operator overloading is possible in C++. C++ programs are divided into functions and classes. 8) 9) 10) 11) C++ supports the feature of namespace. C++ provides exception handling using Try and Catch block. OOP paradigm  Programs are divided into objects.  Data structure is designed such that they characterize the object.  Method that operate on the data of an object are tied together in the data structure  Data is hidden and cannot be accessed by external functions.  OOP is a better way of solving computer problems compared to a procedural programming language such as C. OOP uses classes which contain members (variables) and methods (functions). OOP uses a modular type of programming structure.  OOP is a type of programming in which programmers define not only the data type of a data structure, but also the types of operations that can be applied to the data structure. In this way, the data structure becomes an object that includes both data and functions. By Mr. Umesh Kumar, MCA (GGU) Page | 3

Text from page-4

 In order to use the OOP paradigm, a programmer can use one of the programming languages such as C++, Java or Smalltalk.  The C++ programming language provides a model of memory and computation that closely matches that of most computers. In addition, it provides powerful and flexible mechanisms for abstraction; that is, language constructs that allow the programmer to introduce and use new types of objects that match the concepts of an application.  These higher-level styles of programming are often called data abstraction, object-oriented programming, and generic programming. Features of OOP C++ is object oriented programming language and it is a very simple and easy language, it is the enhanced form of C programming language. This language has following features and here we discuss some important features of C++. 1. Simple 2. Machine Independent or Portable 3. Mid-level programming language 4. Structured programming language 5. Rich Library 6. Memory Management 7. Fast Speed 8. Pointers 9. Recursion 10. Extensible 11. Object Oriented 12. Compiler based 1) Simple-: Every C++ program can be written in simple English language so that it is very easy to understand and developed by programmer. 2) Machine Independent or Portable Unlike assembly language, c programs can be executed in many machines with little bit or no change. But it is not platform-independent. 3) Mid-level programming language C++ is also used to do low level programming. It is used to develop system applications such as kernel, driver etc. It also supports the feature of high level language. That is why it is known as mid-level language. 4) Structured programming language C++ is a structured programming language in the sense that we can break the program into parts using functions. So, it is easy to understand and modify. 5) Powerful By Mr. Umesh Kumar, MCA (GGU) Page | 4

Lecture Notes