Syllabus - Object Oriented Programming (CB303)
Computer Science and Business System
Object Oriented Programming (CB303)
III
Procedural programming, An Overview of C: Types Operator and Expressions, Scope and Lifetime, Constants, Pointers, Arrays, and References, Control Flow, Functions and Program Structure, Namespaces, error handling, Input and Output (C-way), Library Functions (string, math, stdlib), Command line arguments, Pre-processor directive
Some difference between C and C++: Single line comments, Local variable declaration within function scope, function declaration, function overloading, stronger type checking, Reference variable, parameter passing – value vs reference, passing pointer by value or reference, #define constant vs const, Operator new and delete, the typecasting operator,Inline Functions in contrast to macro, default arguments
The Fundamentals of Object Oriented Programming: Necessity for OOP, Data Hiding, Data Abstraction, Encapsulation, Procedural Abstraction, Class and Object.
More extensions to C in C++ to provide OOP Facilities: Scope of Class and Scope Resolution Operator, Member Function of a Class, private, protected and public Access Specifier, this Keyword, Constructors and Destructors, friend class, error handling (exception)
Essentials of Object Oriented Programming: Operator overloading, Inheritance – Single and Multiple, Class Hierarchy, Pointers to Objects, Assignment of an Object to another Object, Polymorphism through dynamic binding, Virtual Functions, Overloading, overriding and hiding, Error Handling
Generic Programming: Template concept, class template, function template, template specialization
Input and Output: Streams, Files, Library functions, formatted output
Object Oriented Design and Modelling: UML concept, Use case for requirement capturing, Class diagram, Activity diagram and Sequence Diagram for design, Corresponding C++ code from design
Course Objective
To introduce the students to the concepts of object-oriented programming using C++ and develop their skills in designing and implementing object-oriented programs.
Course Outcome
Upon completion of this course, students will be able to: 1. Understand the fundamentals of object-oriented programming 2. Implement classes, objects, and inheritance in C++ 3. Use templates and generic programming in C++ 4. Handle input and output operations in C++ 5. Design and model systems using UML 6. Implement various data structures and algorithms in C++ 7. Apply object-oriented principles to solve real-world problems
Practicals
- Parameter passing: passing parameter by value vs by reference, passing array as constant pointer
- Function overloading: writing string operations like strcat and strncat, strcpy and strncpy as overloaded functions.
- Dynamically allocating space for a pointer depending on input and doing this repeatedly, depending on different inputs and finally de-allocating the pointer.
- Define class complex with all possible operations: constructor, destructor, copy constructor, assignment operator with the data members stored as pointer to integers.
- Define class vector of integers with all possible operations like constructor, destructor, copy constructor and assignment operators
- Define class matrix of integers with all possible operations like constructor, destructor, copy constructor and assignment operators
- Define class matrix of integers using vector, with all possible operations like constructor, destructor, copy constructor and assignment operators
- Define class stack, queue, linked-list, array, set using some data-type (int) with data members kept as private and functions kept in both protected and public sections.
- Define class complex with all possible operators: constructor, destructor, copy constructor, assignment operator and operators >, <, >=, <=, ==, ++ (pre and post), +, +=, ( ), with the data members stored as pointer to integers.
- Define class vector of integers with all possible operations like constructor, destructor, copy constructor and assignment operators>, <, >=, <=, ==, ++ (pre and post), +, +=, ( )
- Define class matrix of integers with all possible operations like constructor, destructor, copy constructor and assignment operators>, <, >=, <=, ==, ++ (pre and post), +, +=, ( ).
- Define class matrix of integers using vector, with all possible operations like constructor, destructor, copy constructor and assignment operators>, <, >=, <=, ==, ++ (pre and post), +, +=, ( ).
- Define stack and queue inherited from array class, with standard functions and operators
- Define a class called ‘array’ with data type passed as template type with constructor, destructor, copy constructor and assignment operators and index operator.
- Define template functions for compare and use it in the algorithms like bubble sort, insertion sort, merge sort.
- Formatted input-output examples
- Input manipulators
- Overriding operators <<, >>
- Define class model for complex number, student class, book class and show it using UML diagram as well as concrete class.
- Show behavioural modelling through sequence diagram and activity diagram for workflow in a typical log-in, log-out situation.
Reference Books
-
The C++ Programming Language, Bjarne Stroustrup, Addison Wesley.
-
C++ and Object-Oriented Programming Paradigm, Debasish Jana, PHI Learning Pvt. Ltd.