Object-Oriented Programming (BTCS 302-18) - Theory

Course Objectives

The main objective of this course is to introduce students to the principles of Object-Oriented Programming using C++. The course will cover the following concepts:

Course Outcomes

Upon completion of this course, students will be able to:

  1. Design and implement object-oriented programs using C++
  2. Utilize concepts like inheritance and polymorphism to create reusable and maintainable code
  3. Apply operator overloading and exception handling mechanisms
  4. Perform file operations in C++ programs
  5. Understand and implement generic programming using templates

Detailed Syllabus

Module I

Review of C, Basic concepts of OOP: Object, class, data abstraction, data encapsulation, inheritance, polymorphism, dynamic binding, message passing.

Module II

C++ Programming basics: Structure of C++ programs, Basic input/output statements, Tokens, expressions, and control structures, Functions in C++, Inline functions, Function overloading, Friend and virtual functions, Classes and objects: Declaring classes, defining member functions, Making an outside function inline, nesting of member functions, private member functions, arrays within a class, Memory allocation for objects, static data members, static member functions, arrays of objects, objects as function arguments, friendly functions, returning objects, constant member functions, pointers to members, local classes.

Module III

Constructors and destructors, parameterized constructors, multiple constructors in a class, constructors with default arguments, dynamic initialization of objects, copy constructor, dynamic constructors, const objects, destructors.

Module IV

Operator overloading and type conversions: Defining operator overloading, overloading unary operators, overloading binary operators, overloading binary operators using friends, manipulation of strings using operators, rules for overloading operators, type conversions.

Module V

Inheritance: Defining derived classes, single inheritance, making a private member inheritable, multilevel inheritance, multiple inheritance, hierarchical inheritance, hybrid inheritance, virtual base classes, abstract classes, constructors in derived classes, member functions in derived classes.

Module VI

Pointers, virtual functions, and polymorphism: Pointers, pointers to objects, this pointer, pointers to derived classes, virtual functions, pure virtual functions.

Module VII

Managing console I/O operations, working with files, classes for file stream operations, opening and closing files, detecting end-of-file, file modes, file pointers and their manipulations, sequential input and output operations, updating a file: random access, error handling during file operations, command-line arguments.

Module VIII

Templates, Exception handling: Function templates, class templates, member function templates, overloading of template functions, exception handling mechanism, throwing mechanism, catching mechanism, re-throwing an exception, exception specifications, constructor, and destructor with exception handling.

Suggested Readings


Object-Oriented Programming Lab (BTCS 304-18)

List of Experiments (Expandable)

  1. Develop programs using the concepts of classes, objects, constructors & destructors and member functions.
  2. Write programs to implement various types of Inheritance.
  3. Develop programs to implement the concept of polymorphism.
  4. Develop programs to implement operator overloading.
  5. Write programs for file handling.
  6. Write programs to implement the concept of Templates.
  7. Develop programs to implement Exception handling.

Course Outcomes

Upon completion of this lab, students will be able to:

  1. Implement OOP concepts in C++ programs.
  2. Gain hands-on experience with inheritance, polymorphism, operator overloading, and file handling.
  3. Understand and apply exception handling mechanisms.
  4. Utilize templates for generic programming.