True wisdom comes to each of us when we realize how little we understand about life, ourselves, and the world around us - Socrates

Object Oriented Programming in C++

Teaching -> Object Oriented Programming in C++

Duration: Approximately 30 lecture hours 

Prerequisites: Basic knowledge in C++ or C constructs

Course contents:
  1. Introduction
    Procedure-Oriented Programming, OOP Paradigm, Basic Concepts of OOP (Objects, Classes, Encapsulation, Data hiding, Data abstraction, Inheritance, Polymorphism), Benefits of OOP
  2. Classes and objects
    C++ Structures, C++ Structures and Classes, Class definition, Private and Public members, Creating objects, Accessing Class Members, Defining Member Functions, Private Member Functions, Memory Allocation of Objects, Static Data Members, Objects as Function Arguments, Friend Functions and Classes, Retuning Objects
  3. Constructors and destructors
    Mutator and Accessor Routines, Default Constructors, Parameterized Constructors, Constructors with default arguments, Copy Constructor, and Destructor.
  4. Inheritance
    Introduction, General Form, Single Inheritance, Protected Members, Visibility of inherited members, Multiple Inheritance, Virtual Functions.
  5. Operator overloading
    Introduction, General Form, Binary Operators, Unary Operators, Member Function or Friend Function, Insertors and Extractors.
  6. Polymorphism
    Introduction, Virtual member functions, Benifits of virtual member functions, Late and early binding, Abstract classes, Virtual destructors.
  7. File Processing
    Sequential files, Random Access Files.

Objectives:
  • To introduce object oriented programming concepts and implement them in C++.

Learning outcomes: 
  • Describe the differences between procedure oriented programming and object oriented programming. 
  • Define the three key features of the object-oriented programming language: encapsulation (abstraction), inheritance, and polymorphism. 
  • Describe the benifits of object oriented programmng. 
  • Declare a class. 
  • Create objects, array of objects, and pointer to an object of a class. 
  • Identify the differences between private, public and protected members of a class. 
  • Describe how to access private, public and protected members of a class. 
  • Define member functions inside the class definition and outside the class definition.
  • Understand the memory allocation of objects and class methods.
  • Declare and use static data members and static methods.
  • Design and use friend functions and friend classes.
  • Use constructor and destructor functions to initialize and destroy class objects.
  • Use inheritance to build class hierarchies. 
  • Overload operators to work with user-defined classes.
  • Apply the facilities offered by C++ for Object-Oriented Programming.
  • Create, read, write and update files.
  • Implement programs with sequential access and random access file processing.
  • Design and implement object-oriented applications.
  • Understand the difference between normal member functions and virtual member functions.
  • Identify benifits of using virtual functions.
  • Describe the diffrence between late binding and early binding.
  • Describe and use of abstract classes.
  • Describe the importance of virtual destructors.

Method of assessments:
  • Continuous assessments - 40%
  • Final examination - 60%

Attendance:
  • Only those who satisfy the requirement of attendance (at least 80%) at lectures are allowed to sit the end of semester examination.
  • Students who misbehave in the class will be asked to leave the class. If a student  is asked to leave a lecture, this will count as an absence. 

Recommended reading:
  • Stephen Prata. C++ Primer Plus. Galgotia Publication (Pvt) Ltd.
  • E. Balagurusami. Object-Oriented Programming with C++. BPG Publications.