Lecture: 3
Tutorial: 1
Practical: 3
Year: I
Part: II
Course Objectives
To provide students with foundation in understanding and applying principles of object oriented programming. Emphasis will be given on developing object oriented programming skills using C++.
1. Introduction to Object Oriented Programming (3 hours)
- History of programming languages
- Need of object oriented programming
- Object oriented programming vs procedure oriented programming
- Concepts of object oriented programming
- Popular object oriented languages
- Advantages of OOP
- Disadvantages of OOP
2. Basics of C++ Programming (5 hours)
- C++ Program structure
- Character set and tokens
- Variable declaration and expression
- Data types
- Type conversion and casting
- User defined constant const
- Reference variables
- Conditions and looping
- Namespace scope
- Functions: Function overloading, inline function, default arguments, pass by reference and return by reference
- Array, pointer and string
- Structure and unions
- Enumeration
- Dynamic memory allocation
3. Objects and Classes (7 hours)
- C++ classes
- Objects and the member access
- Relation of object, class and memory
- Defining member function
- Defining outer function inline
- Objects as member
- Constructors and destructors
- Object as function arguments
- Returning objects from functions
- Array of objects
- Pointer to objects
- Dynamic memory allocation for objects
- Dynamic constructors
- Pointer
- Static data member and static member function
- Constant member functions and constant objects
- Friend functions and friend classes
4. Operator Overloading (5 hours)
- Overloadable and non-overloadable operators
- Syntax of operator overloading
- Operator overloading using member operator functions
- Operator overloading using non member functions
- Unary operator overloading
- Binary operator overloading
- Type conversion between objects
- Explicit constructors
5. Inheritance (5 hours)
- Base class and derived class
- Protected access specifier
- Derived class declaration
- Is_a relation and Has_a relation
- Public, protected and private inheritance
- Member overriding
- Forms of inheritance
- Constructors in derived class
- Destructor in derived class
- Need of virtual base class
6. Virtual Functions (4 hours)
- What is virtual function
- Need of virtual function
- Pointer to derived class
- Array of pointers to base class
- Pure virtual functions and abstract class
- Virtual destructors
- Reinterpret cast operator
- Run-time type information
7. Stream Computation (6 hours)
- Input/Output stream class hierarchy
- Testing stream errors
- Unformatted input/output and formatted input/output
- Stream operator overloading
- File input/output with streams
- File stream class hierarchy
- ASCII and binary files
- Read/Write from file
- Sequential access to file
- Random access to file
- File access pointers and their manipulators
- Testing errors during file operations
- File input/output with member functions
8. Templates (6 hours)
- Function template
- Overloading function template
- Class template
- Derived class template
- Introduction to standard template library: Components of STL, container, iterators, algorithms
9. Exception Handling (4 hours)
- Basics of exception handling
- Advantage over conventional error handling
- Exception handling mechanism
- Multiple handlers
- Catching all exceptions
- Rethrowing exception
- Exception with arguments
- Exceptions specification for function
- Exceptions in constructors and destructors
- Handling uncaught exceptions
- Handling unexpected exception
Tutorial
After completing each chapter some problems are solved and students are asked to solve programming problems with the teacher’s assistance.
Assignment
Appropriate assignment problems are given to students after the completion of each chapter.
Laboratory
There will be 9 labs covering all the course. At the end of the course students must submit a programming project on object oriented programming.
Final Examination
Chapter | Hours | Marks Distribution* |
---|---|---|
1 | 3 | 4 |
2 | 5 | 7 |
3 | 7 | 9 |
4 | 5 | 7 |
5 | 5 | 7 |
6 | 4 | 5 |
7 | 6 | 8 |
8 | 6 | 8 |
9 | 4 | 5 |
Total | 45 | 60 |
There may be minor deviation in marks distribution.
References
- Herbert Schildt (2012). “C++ : Complete Reference”, 5th Edition, Tata McGraw Hill
- D.S. Baral, D. Baral (2010). “Secrets of Object Oriented Programming in C++”, Bhundipuran Prakasan
- Robert Lafore (2002). “Object Oriented Programming in C++”, 4th Edition, Sams Publication
- H. M. Deitel and P. J. Deitel (2008). “C++ How to Program”, 6th Edition, Pearson Education Inc