Preview File1
Preview File1
To describe programming, algorithm and its structure, sequences, loops and control flow structure.
To illustrate the structured and objective oriented programming, pointer declaration and initialization.
To demonstrate the applications of encapsulation and data hiding, specifies, constructors and inheritance.
To analyze various types of aggregation, composition, overriding, latch and C++
Course Topics / Major Contents
Introduction to object oriented design, history and advantages of object oriented design, introduction to object oriented
programming
concepts, classes, objects, data encapsulation, constructors, destructors, access modifiers, const vs non-const functions, static
data
members & functions, function overloading, operator overloading, identification of classes and their relationships, composition,
aggregation, inheritance, multiple inheritance, polymorphism, abstract classes and interfaces, generic programming concepts,
function & class templates, standard template library, object streams, data and object serialization using object streams,
exception
handling.
▶ Encapsulation
▶ Instance Variable Initializers
▶ Access Modifiers
Bundling similar data members and functions inside a class together also helps in data hiding.
In C++, we can bundle data members and functions that operate together
inside a single class. For example,
In the above program, the function getArea() calculates the area of a rectangle. To calculate the area,
it needs length and breadth.
Hence, the data members (length and breadth) and the function getArea() are kept together in the
Rectangle class.
To calculate an area, we need two variables: length and breadth and a function: getArea(). Hence, we
bundled these variables and function inside a single class named Rectangle.
Here, the variables and functions can be accessed from other classes as well. Hence, this is not data
hiding.
Data Hiding
Data hiding is a way of restricting the access of our data members by hiding the implementation
details. Encapsulation also provides a way for data hiding.
If we try to access the variables from the main() class, we will get an error.
Reference Books
C++ How To Program 10th Edition Deitel & Deitel
Objet oriented Programming in C++ 3rd Edition By Robert Lafore