NotesM.Sc ITObject Oriented Programming using C++
PGCA1911

Object Oriented Programming using C++ Notes

Program:M.Sc IT
Semester:Semester 2
Credits:4
Units:4 Units

Subject Overview

This paper builds object-oriented programming skills in C++ — program fundamentals and control structures, arrays/strings/structures, classes and constructors, and inheritance, operator overloading and file handling. A 4-credit core theory paper.

Unit-wise Syllabus

4 units — open any unit for detailed topic-wise notes, diagrams and important exam questions

  • OOP introduction and basic features
  • C++ program structure
  • compiling and executing programs
  • procedural vs object-oriented languages
  • I/O and assignment statements
  • constants
  • variables
  • operators
  • data types
  • control structures (if-else, nested if, while, do-while, for, jump statements)
ComparisonProcedural vs object-oriented programming
Procedural
Object-oriented

Focus

Functions and steps

Objects with data and behaviour

Data

Often global, shared

Encapsulated in classes

Reuse

Copy functions

Inheritance and polymorphism

Examples

C

C++, Java

Study guide

This unit covers the OOP approach, C++ program structure, compiling and running, procedural versus OO languages, I/O, constants, variables, operators, data types and control structures. Write and run programs as you read.

Read Unit 1 notes
  • Array declaration
  • single and multi-dimensional arrays
  • memory representation
  • matrices
  • strings and string handling functions
  • structures and unions
ComparisonArrays vs structures
Array
Structure

Holds

Many items of one type

Items of different types

Access

By index: a[2]

By member name: s.age

Example

int marks[5];

struct Student {int roll; char name[20];};

Study guide

You study arrays (single and multi-dimensional), memory representation, matrices, strings and string functions, structures and unions. Practise matrix and string programs.

Read Unit 2 notes
  • Class and function definitions
  • scope resolution operator
  • private/protected/public members
  • nesting of member functions
  • object creation and access
  • parameterized and copy constructors
  • multiple constructors
  • dynamic initialization
  • destructors
ComparisonTypes of constructors
Purpose
Example

Default

No arguments

Box b;

Parameterised

Takes values

Box b(2, 3);

Copy

Copies another object

Box c(b);

Destructor

Releases resources

~Box()

Study guide

You study classes, member functions, scope resolution, access specifiers, nesting, objects, constructors (parameterised, copy, multiple), dynamic initialisation and destructors. Model a real entity as a class.

Read Unit 3 notes
  • Constructors/destructors under inheritance
  • single/multiple/multilevel/hierarchical/hybrid inheritance
  • function/unary/binary operator overloading
  • binding
  • friend and virtual functions
  • file opening/closing
  • file modes and methods
ClassificationTypes of inheritance
Inheritance
  • Single

    One base, one derived

  • Multiple

    Two or more bases

  • Multilevel

    A → B → C

  • Hierarchical

    One base, many derived

  • Hybrid

    A mix of the above

Study guide

You study constructors under inheritance, the five inheritance types, function and operator overloading, binding, friend and virtual functions and file handling. Understand when virtual functions are needed.

Read Unit 4 notes

Why Object Oriented Programming using C++ Matters

OOP in C++ builds design discipline that carries over to Java and Python and is a staple of interviews.

How to Prepare for Object Oriented Programming using C++

  • Code every OOP concept in a small program.
  • Learn the difference between overloading and overriding.
  • Draw class diagrams before coding.

Object Oriented Programming using C++: Frequently Asked Questions

What is polymorphism?

Polymorphism allows the same function name or operator to behave differently depending on context, through overloading or virtual functions.

Want the Complete Notes & Past Papers?

WhatsApp us and we'll send you the full notes, question banks, and previous year papers for Object Oriented Programming using C++.