This repository contains complete C++ implementations of all programs and examples from "Object-Oriented Programming with C++ (4th Edition)" by E. Balagurusamy. It serves as a practical coding companion to the textbook, providing working implementations for students and educators covering all 16 chapters of OOP concepts.
1.1 Software Crisis
1.2 Software Evolution
1.3 A Look at Procedure-Oriented Programming
1.4 Object-Oriented Programming Paradigm
1.5 Basic Concepts of Object-Oriented Programming
1.6 Benefits of OOP
1.7 Object-Oriented Languages
1.8 Applications of OOP
π Summary | Review Questions
2.1 What is C++?
2.2 Applications of C++
2.3 A Simple C++ Program
2.4 More C++ Statements
2.5 An Example with Class
2.6 Structure of C++ Program
2.7 Creating the Source File
2.8 Compiling and Linking
π Summary | Review Questions | Debugging Exercises | Programming Exercises
3.1 Introduction
3.2 Tokens
3.3 Keywords
3.4 Identifiers and Constants
3.5 Basic Data Types
3.6 User-Defined Data Types
3.7 Derived Data Types
3.8 Symbolic Constants
3.9 Type Compatibility
3.10 Declaration of Variables
3.11 Dynamic Initialization of Variables
3.12 Reference Variables
3.13 Operators in C++
3.14 Scope Resolution Operator
3.15 Member Dereferencing Operators
3.16 Memory Management Operators
3.17 Manipulators
3.18 Type Cast Operator
3.19 Expressions and their Types
3.20 Special Assignment Expressions
3.21 Implicit Conversions
3.22 Operator Overloading
3.23 Operator Precedence
3.24 Control Structures
π Summary | Review Questions | Debugging Exercises | Programming Exercises
4.1 Introduction
4.2 The Main Function
4.3 Function Prototyping
4.4 Call by Reference
4.5 Return by Reference
4.6 Inline Functions
4.7 Default Arguments
4.8 const Arguments
4.9 Function Overloading
4.10 Friend and Virtual Functions
4.11 Math Library Functions
π Summary | Review Questions | Debugging Exercises | Programming Exercises
5.1 Introduction
5.2 C Structures Revisited
5.3 Specifying a Class
5.4 Defining Member Functions
5.5 A C++ Program with Class
5.6 Making an Outside Function Inline
5.7 Nesting of Member Functions
5.8 Private Member Functions
5.9 Arrays within a Class
5.10 Memory Allocation for Objects
5.11 Static Data Members
5.12 Static Member Functions
5.13 Arrays of Objects
5.14 Objects as Function Arguments
5.15 Friendly Functions
5.16 Returning Objects
5.17 const Member Functions
5.18 Pointers to Members
5.19 Local Classes
π Summary | Review Questions | Debugging Exercises | Programming Exercises
6.1 Introduction
6.2 Constructors
6.3 Parameterized Constructors
6.4 Multiple Constructors in a Class
6.5 Constructors with Default Arguments
6.6 Dynamic Initialization of Objects
6.7 Copy Constructor
6.8 Dynamic Constructors
6.9 Constructing Two-dimensional Arrays
6.10 const Objects
6.11 Destructors
π Summary | Review Questions | Debugging Exercises | Programming Exercises
7.1 Introduction
7.2 Defining Operator Overloading
7.3 Overloading Unary Operators
7.4 Overloading Binary Operators
7.5 Overloading Binary Operators Using Friends
7.6 Manipulation of Strings Using Operators
7.7 Rules for Overloading Operators
7.8 Type Conversions
π Summary | Review Questions | Debugging Exercises | Programming Exercises
8.1 Introduction
8.2 Defining Derived Classes
8.3 Single Inheritance
8.4 Making a Private Member Inheritable
8.5 Multilevel Inheritance
8.6 Multiple Inheritance
8.7 Hierarchical Inheritance
8.8 Hybrid Inheritance
8.9 Virtual Base Classes
8.10 Abstract Classes
8.11 Constructors in Derived Classes
8.12 Member Classes: Nesting of Classes
π Summary | Review Questions | Debugging Exercises | Programming Exercises
9.1 Introduction
9.2 Pointers
9.3 Pointers to Objects
9.4 this Pointer
9.5 Pointers to Derived Classes
9.6 Virtual Functions
9.7 Pure Virtual Functions
π Summary | Review Questions | Debugging Exercises | Programming Exercises
10.1 Introduction
10.2 C++ Streams
10.3 C++ Stream Classes
10.4 Unformatted I/O Operations
10.5 Formatted Console I/O Operations
10.6 Managing Output with Manipulators
π Summary | Review Questions | Debugging Exercises | Programming Exercises
11.1 Introduction
11.2 Classes for File Stream Operations
11.3 Opening and Closing a File
11.4 Detecting end-of-file
11.5 More about Open(): File Modes
11.6 File Pointers and Their Manipulations
11.7 Sequential Input and Output Operations
11.8 Updating a File: Random Access
11.9 Error Handling During File Operations
11.10 Command-line Arguments
π Summary | Review Questions | Debugging Exercises | Programming Exercises
12.1 Introduction
12.2 Class Templates
12.3 Class Templates with Multiple Parameters
12.4 Function Templates
12.5 Function Templates with Multiple Parameters
12.6 Overloading of Template Functions
12.7 Member Function Templates
12.8 Non-Type Template Arguments
π Summary | Review Questions | Debugging Exercises | Programming Exercises
13.1 Introduction
13.2 Basics of Exception Handling
13.3 Exception Handling Mechanism
13.4 Throwing Mechanism
13.5 Catching Mechanism
13.6 Rethrowing an Exception
13.7 Specifying Exceptions
π Summary | Review Questions | Debugging Exercises | Programming Exercises
14.1 Introduction
14.2 Components of STL
14.3 Containers
14.4 Algorithms
14.5 Iterators
14.6 Application of Container Classes
14.7 Function Objects
π Summary | Review Questions | Debugging Exercises | Programming Exercises
15.1 Introduction
15.2 Creating (string) Objects
15.3 Manipulating String Objects
15.4 Relational Operations
15.5 String Characteristics
15.6 Accessing Characters in Strings
15.7 Comparing and Swapping
π Summary | Review Questions | Debugging Exercises | Programming Exercises
16.1 Introduction
16.2 New Data Types
16.3 New Operators
16.4 Class Implementation
16.5 Namespace Scope
16.6 Operator Keywords
16.7 New Keywords
16.8 New Headers
π Summary | Review Questions | Debugging Exercises | Programming Exercises
Object-Oriented-Programming-with-C-Plus-plus-by-BALAGURUSAMY/
β
βββ Chapter 01/ # Principles of Object-Oriented Programming
βββ Chapter 02/ # Beginning with C++
βββ Chapter 03/ # Tokens, Expressions and Control Structures
βββ Chapter 04/ # Functions in C++
βββ Chapter 05/ # Classes and Objects
βββ Chapter 06/ # Constructors and Destructors
βββ Chapter 07/ # Operator Overloading and Type Conversions
βββ Chapter 08/ # Inheritance: Extending Classes
βββ Chapter 09/ # Pointers, Virtual Functions and Polymorphism
βββ Chapter 10/ # Managing Console I/O Operations
βββ Chapter 11/ # Working with Files
βββ Chapter 12/ # Templates
βββ Chapter 13/ # Exception Handling
βββ Chapter 14/ # Introduction to the Standard Template Library
βββ Chapter 15/ # Manipulating Strings
βββ Chapter 16/ # New Features of ANSI C++ Standard
βββ LICENSE
βββ README.md
| Chapter | Title | Status | Files | Last Updated |
|---|---|---|---|---|
| 01 | Principles of OOP | β Complete | Theoretical concepts | May 30, 2021 |
| 02 | Beginning with C++ | β Complete | Basic programs | May 30, 2021 |
| 03 | Tokens & Control Structures | β Complete | Multiple programs | May 30, 2021 |
| 04 | Functions in C++ | β Complete | Function examples | May 31, 2021 |
| 05 | Classes and Objects | β Complete | Class implementations | May 31, 2021 |
| 06 | Objects and Classes | β Complete | Object programs | Jun 1, 2021 |
| 07 | Arrays and Strings | β Complete | Array/string programs | Dec 5, 2021 |
| 08 | Inheritance | β Complete | Inheritance examples | Jun 8, 2021 |
| 09 | Pointers & Polymorphism | β Complete | Pointer programs | Jun 9, 2021 |
| 10 | Console I/O | β Complete | I/O operations | Jun 10, 2021 |
| 11 | Working with Files | β Complete | File handling | Jun 14, 2021 |
| 12 | Templates | β Complete | Template programs | Jun 24, 2021 |
| 13 | Exception Handling | β Complete | Exception examples | Jun 25, 2021 |
| 14 | STL Introduction | β Complete | STL programs | Jun 26, 2021 |
| 15 | Manipulating Strings | β Complete | String programs | Jun 26, 2021 |
| 16 | New ANSI C++ Features | β Complete | New feature demos | Jun 27, 2021 |
Repository Statistics:
- Total Chapters: 16 (Complete implementation)
- Total Sub-Chapters: 150+ detailed sections
- Primary Language: C++ (100%)
- Total Commits: 19
- First Commit: May 30, 2021
- Last Update: Dec 5, 2021
- Edition: Based on 4th Edition of Balagurusamy textbook
- Week 1-2: OOP principles and C++ basics
- Week 3-4: Control structures and functions
- Focus: Building programming foundation
- Week 5-6: Classes, objects, constructors/destructors
- Week 7-8: Operator overloading, inheritance, polymorphism
- Focus: Mastering object-oriented design
- Week 9-10: I/O operations, file handling, templates
- Week 11-12: Exception handling, STL, strings, new features
- Focus: Professional C++ development
# Compile a basic class example
g++ -std=c++11 "Chapter 05/5.5_class_program.cpp" -o class_demo
# Compile inheritance example
g++ -std=c++11 "Chapter 08/8.3_single_inheritance.cpp" -o inheritance_demo
# Compile template example
g++ -std=c++11 "Chapter 12/12.2_class_template.cpp" -o template_demo- Start with Chapter 2 for C++ basics if you're new to programming
- Study Chapter 1 for OOP theory foundation
- Follow chapter order (3-16) for progressive learning
- Practice with debugging and programming exercises
- Find a topic in the Chapter Index above
- Navigate to the corresponding chapter folder
- Look for files named by section number or topic
- Compile and run to see the implementation
Chapter_XX/XX.YY_topic_name.cpp(e.g.,Chapter_05/5.15_friendly_functions.cpp)Chapter_XX/exercise_XX.cppfor programming exercisesChapter_XX/debug_XX.cppfor debugging exercises
- Add missing implementations for specific sub-chapters
- Improve code comments and documentation
- Add test cases for existing programs
- Update to modern C++ standards (C++14/17/20)
- Create example outputs in comments
- Follow consistent naming conventions
- Include comments explaining key concepts
- Reference the textbook section number
- Test code before submitting
- Title: Object-Oriented Programming with C++
- Author: E. Balagurusamy
- Edition: Fourth Edition
- Publisher: McGraw Hill Education
- Total Chapters: 16 + Appendices
- Total Pages: 600+ pages of comprehensive OOP coverage
Happy OOP Learning! π
Complete implementations of all 16 chapters from Balagurusamy's 4th Edition
Maintainer: Feroz455 | Based on "Object-Oriented Programming with C++ (4th Edition)" by E. Balagurusamy