The book "Object Oriented Programming C++ Simplified"has been written for the students who are little experienced in the field of programming. It is an introductory level text that instills an understanding of the basic concepts before gradually moving to advanced topics on object oriented programming. Programs given are accompanied by complete explanation, and their output helps the reader to better understand the logic behind them. Written in a lucid language, the book is enriched with the following features: Lucid explanation of OOP concept. Basic C features in a nutshell. Over 700 thoroughly explained programs. Plenty of exercises. Description of file handling with more than 40 fully explained programs. Detailed coverage of Standard Template Library. Emphasis on new features of C++.
Author(s): Hari Mohan Pandey
Publisher: LAXMI PUBLICATIONS
Year: 2013
Front Cover
Contents
CHAPTER 0 : INTRODUCTION TO OOPs
Structured Programming
Procedural Programming
Programming Methodology
Object-Oriented Programming
Basic Concepts of OOPs
Characteristics of OOPs
Advantages of OOPs
Object-Oriented Languages
Object-based Languages
CHAPTER 1 : INTRODUCTION OF OBJECT-ORIENTED DESIGN
1.1 Introduction
1.2 Objects
1.3 Class and Instance
1.4 Polymorphism
1.5 Inheritance
1.6 Object-Oriented Analysis
1.7 Finding the Objects
1.8 Conceptual Modeling
1.9 Requirements Model
1.10 Analysis Model
1.11 The Design Model
1.12 The Implementation Model
1.13 Test Model
1.14 Object-Oriented Analysis and Design
1.15 The Evolution of Object Model
1.16 Object-Oriented Programming
1.17 Object-Oriented Design
1.18 Object-Oriented Analysis
1.19 Elements of Object Model
1.20 The Role of OOAD in the Software Life Cycle
1.21 OOAD Methodologies
1.22 Grady Booch Approach
CHAPTER 2 : STARTING WITH C++
2.1 C++ Overview
2.2 C++ Character Set
2.3 C++ Tokens
2.4 Variables
2.5 Counting Tokens
2.6 Data Types
2.7 Qualifiers
2.8 Range of Data Types
2.9 Your First C++ Program
2.10 Structure of a C++ Program
2.11 Styles of Writing C++ Programs
2.12 Programming Examples
2.13 Ponderable Points
Exercise
CHAPTER 3 : C FEATURES OF C++
3.1 Introduction
3.2 Operators and Expressions
3.3 Declaring Constants
3.4 Type Conversion
3.5 Decision Making: An Introduction
3.6 Unconditional Branching Using Goto
3.7 Introduction to Looping
3.8 Points to Ponder
Exercise
CHAPTER 4 : OPERATORS AND REFERENCES IN C++
4.1 Introduction
4.2 Scope Resolution Operator
4.3 Reference Variables
4.4 The Bool Data Type
4.5 The Operator New and Delete
4.6 Malloc Vs New
4.7 Pointer Member Operators
4.8 Ponderable Points
Exercise
CHAPTER 5 : FUNCTION IN C++
5.1 Introduction
5.2 Function Declaration/Prototyping
5.3 The Main Function in C++
5.4 Recursion
5.5 Call by Reference
5.6 Call by Reference Vs Call by Address
5.7 Return by Reference
5.8 Inline Function
5.9 Function Overloading
5.10 Function with Default Arguments
5.11 Ponderable Points
Exercise
CHAPTER 6 : CLASS AND OBJECTS IN C++
6.1 Working with Class
6.2 Programming Examples (Part-1)
6.3 Structure in C++
6.4 Accessing Private Data
6.5 Programming Example (Part-2)
6.6 Passing and Returning Object
6.7 Array of Object
6.8 Friend Function
6.9 Static Class Members
6.10 Constant Member Function
Exercise
CHAPTER 7 : WORKING WITH CONSTRUCTOR AND DESTRUCTOR
7.1 Introduction
7.2 Constructor with Parameters
7.3 Implicit and Explicit Call to Constructor
7.4 Copy Constructor
7.5 Dynamic Initialization of Objects
7.6 Dynamic Constructor
7.7 Destructor
7.8 Ponderable Points
Exercise
CHAPTER 8 : WORKING WITH OPERATOR OVERLOADING
8.1 Introduction
8.2 Operator Overloading with Binary Operator
8.3 Overloading Assignment (=) Operator
8.4 Overloading Unary Operators
8.5 Overloading Using Friend Function
8.6 Rules of Operator Overloading
8.7 Type Conversion
8.8 Ponderable Points
Exercise
CHAPTER 9 : WORKING WITH INHERITANCE IN C++
9.1 Introduction
9.2 Types of Inheritance
9.3 Public, Private and Protected Inheritance
9.4 Multiple Inheritance
9.5 Hierarchical Inheritance
9.6 Virtual Base Class
9.7 Constructor and Destructor in Inheritance
9.8 Containership
9.9 Ponderable Points
Exercise
CHAPTER 10 : POINTERS TO OBJECTS AND VIRTUAL FUNCTIONS
10.1 Pointer to Objects
10.2 The This Pointer
10.3 What is Binding in C++ ?
10.4 Virtual Functions
10.5 Working of a Virtual Function
10.6 Rules for Virtual Function
10.7 Pure Virtual Function and Abstract Class
10.8 Object Slicing
10.9 Some Facts about Virtual Function
10.10 Virtual Destructor
10.11 Ponderable Points
Exercise
CHAPTER 11 : INPUT-OUTPUT AND MANIPULATORS IN C++
11.1 Introduction
11.2 C++ Stream Classes
11.3 Unformatted Input/Output
11.4 Formatted Input/Output Operations
11.5 Manipulators
11.6 Ponderable Points
Exercise
CHAPTER 12 : FILE HANDLING IN C++
12.1 Introduction
12.2 File Streams
12.3 Opening and Closing a File
12.4 File Opening Modes
12.5 Checking End of File
12.6 Random Access in File
12.7 Command Line Arguments
12.8 Working with Binary Mode
12.9 Error Handling
12.10 Ponderable Points
Exercise
CHAPTER 13 : TEMPLATE PROGRAMMING
13.1 Introduction
13.2 Function Template
13.3 Class Template
13.4 Ponderable Points
Exercise
CHAPTER 14 : EXCEPTION HANDLING IN C++
14.1 Introduction
14.2 Basics of Exception Handling
14.3 Exception Handling Mechanism
14.4 Programming Examples
14.5 Exception Handling with Class
14.6 Catching all Exceptions
14.7 Specifying Exception for a Function
14.8 Ponderable Points
Exercise
CHAPTER 15 : OBJECT-ORIENTED PROGRAMMING HAND ON LAB
Experiment 1 : Program illustrating function overloading feature
Experiment 2 : Programs illustrating the overloading of various operators. Ex : Binary operators, Unary operators, New and delete operators, etc
Experiment 3 : Programs illustrating the use of following functions : (a) Friend functions (b) Inline functions (c) Static member functions (d) Functions with default arguments
Experiment 4 : Programs to create singly and doubly linked lists and perform insertion and deletion Operations. Using self referential classes, new and delete operators
Experiment 5 : Programs illustrating the use of destructor and the various types of constructors : 1. Constructor with no arguments 2. Constructors with arguments 3. Copy constructor etc
Experiment 6 : Programs illustrating the various forms of inheritance : 1. Single Inheritance 2. Multiple Inheritances 3. Multilevel Inheritance. 4. Hierarchical inheritance, etc
Experiment 7 : Write a program illustrating the use of virtual functions
Experiment 8 : Write a program which illustrates the use of virtual base class
Experiment 9 : Write a program which uses the following sorting methods for sorting elements in ascending order. Use function templates (a) Bubble sort (b) Selection sort (c) Quick sort
Experiment 10 : Write programs illustrating file handling operations : (a) Copying a text file (b) Displaying the contents of the file, etc
Appendix 1 : Key Elements Used in Trouble Free C++
Appendix 2 : Questions Asked in Technical Interviews
References
Index
Back Cover