×
There is no substitute for HARD WORK.
--Your friends at LectureNotes
Close

Note for Object Oriented Programming Using Cpp - OOP By JNTU Heroes

  • Object Oriented Programming Using Cpp - OOP
  • Note
  • Jawaharlal Nehru Technological University Anantapur (JNTU) College of Engineering (CEP), Pulivendula, Pulivendula, Andhra Pradesh, India - JNTUACEP
  • 12 Topics
  • 81 Views
  • 4 Offline Downloads
  • Uploaded 1 year ago
Jntu Heroes
Jntu Heroes
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-2

SYLLABUS Module I (08 hrs) Introduction to object oriented programming, user defined types, structures, unions, polymorphism, and encapsulation. Getting started with C++ syntax, data-type, variables, strings, functions, default values in functions, recursion, namespaces, operators, flow control, arrays and pointers. Module II (16 hrs) Abstraction mechanism: Classes, private, public, constructors, destructors, member data, member functions, inline function, friend functions, static members, and references. Inheritance: Class hierarchy, derived classes, single inheritance, multiple, multilevel, hybrid inheritance, role of virtual base class, constructor and destructor execution, base initialization using derived class constructors. Polymorphism: Binding, Static binding, Dynamic binding, Static polymorphism: Function Overloading, Ambiguity in function overloading, dynamic polymorphism: Base class pointer, object slicing, late binding, method overriding with virtual functions, pure virtual functions, abstract classes. Operator Overloading: This pointer, applications of this pointer, Operator function, member and non member operator function, operator overloading, I/O operators. Exception handling: Try, throw, and catch, exceptions and derived classes, function exception declaration, unexpected exceptions, exception when handling exceptions, resource capture and release. Module III (16 hrs) Dynamic memory management, new and delete operators, object copying, copy constructor, assignment operator, virtual destructor. Template: template classes, template functions. Standard Template Library: Fundamental idea about string, iterators, hashes, iostreams and other types. Namespaces: user defined namespaces, namespaces provided by library. Object Oriented Design, design and programming, role of classes. 2 Provided by JNTU World Team (www.alljntuworld.in)

Text from page-3

CONTENTS Chapter No Chapter Name Chapter 1 Introduction 1 Chapter 2 Class and Object 30 Chapter 3 Inheritance 48 Chapter 4 Polymorphism 64 Chapter 5 Operator Overloading 73 Chapter 6 Exception Handling 82 Chapter 7 Dynamic Memory Management 92 Chapter 8 Templates 99 Chapter 9 Standard Template Library 107 Chapter 10 Namespace 112 Previous Year BPUT Questions 120 3 Provided by JNTU World Team (www.alljntuworld.in) Page No

Text from page-4

Chapter 1 Procedure/ structure oriented Programming • • • Conventional programming, using high level languages such as COBOL, FORTRAN and C, is commonly known as procedure-oriented programming (POP). In the procedure-oriented approach, the problem is viewed as a sequence of things to be done such as reading, calculating and printing. A number of functions are written to accomplish these tasks. The primary focus is on functions. Global Data Global Data Function-1 Function-2 Function-3 Local Data Local Data Local Data Object Oriented Programming • • • • • 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. Objects may communicate with each other through functions. New data and functions can be easily added whenever necessary. Object A Data Functions Object B Data Functions Object C Data Functions 4 Provided by JNTU World Team (www.alljntuworld.in)

Text from page-5

Basic Concepts of Object-Oriented Programming Objects Objects are the basic runtime 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. Class Object contains data, and code to manipulate that data. The entire set of data and code of an object can be made a user-defined data type with the help of a class. Data Encapsulation     The wrapping up of data and functions into a single unit is known as encapsulation. The data is not accessible to the outside world, only those function which are wrapped in the can access it. These functions provide the interface between the object’s data and the program. This insulation of the data from direct access by the program is called data hiding or information hiding. Data Abstraction   Abstraction refers to the act of representing essential features without including the background details or explanations. Since classes use the concept of data abstraction, they are known as Abstract Data Types (ADT). Inheritance   Inheritance is the process by which objects of one class acquire the properties of objects of another class. In OOP, the concept of inheritance provides the idea of reusability. This means we can add additional features to an existing class without modifying it. Polymorphism     Polymorphism, a Greek term means to ability to take more than one form. An operation may exhibits different behaviors in different instances. The behavior depends upon the type of data used in the operation. For example consider the operation of addition for two numbers; the operation will generate a sum. If the operands are string then the operation would produce a third string by concatenation. The process of making an operator to exhibit different behavior in different instances is known operator overloading. 5 Provided by JNTU World Team (www.alljntuworld.in)

Lecture Notes