Object Oriented Programming using C++ Laboratory Notes
Subject Overview
The practical companion to Object Oriented Programming using C++, building programs around classes and objects (a bank account class, a publication/
Subject at a glance
1
Units
12
Topics
1
Credits
1
Infographics
Unit-wise Syllabus
1 units — open any unit for detailed topic-wise notes, diagrams and important exam questions
- Marks entry and totaling with cin/cout
- reference-variable swap function
- largest-of-three function
- factorial program
- bank account class with deposit/withdraw/display
- array-of-objects for multiple accounts
- function overloading for triangle area calculation
- Publication/Book/Tape inheritance hierarchy
- Student/Exam/Result inheritance chain
- unary/binary operator overloading
- virtual function and abstract class programs
- file read/write and file copy programs
Classes and objects
Bank account, array of objects
Constructors
Default, parameterised, copy
Inheritance
Publication/Book/Tape, Student/Exam/Result
Polymorphism
Function and operator overloading, virtual functions
File handling
Read, write and copy files
Study guide
In this lab you write C++ programs that apply OOP: marks entry and totalling with cin and cout, swapping with reference variables, largest of three, factorial, a bank account class with deposit, withdraw and display, an array of objects for several accounts, function overloading for triangle area, a Publication/Book/Tape inheritance hierarchy, a Student/Exam/Result chain, unary and binary operator overloading, virtual functions and abstract classes, and file read, write and copy. Practise explaining how each program demonstrates a specific OOP concept.
Why Object Oriented Programming using C++ Laboratory Matters
Writing real classes and hierarchies is what turns OOP theory into skill, and these programs are the standard exercises in practical exams and entry-level coding tests.
How to Prepare for Object Oriented Programming using C++ Laboratory
- Type and run every program yourself, then modify it to try variations.
- Prepare to explain which OOP feature each program demonstrates.
- Handle file errors in file programs, for example when a file does not exist.
Object Oriented Programming using C++ Laboratory: Frequently Asked Questions
What programs are asked in the C++ lab?
Classes and objects such as a bank account, inheritance hierarchies, operator overloading, virtual functions and abstract classes, and file handling programs.
