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.
Abstraction means displaying only essential information and hiding the details.
Data abstraction refers to providing only essential information about the data to the
outside world, hiding the background details or implementation
Explanation:
•In this example, abstraction is achieved using classes and access specifiers
.
•TestAbstraction class is declared with string x, y as its private members, which means we could
not access these strings outside the class.
•void set(string a, string b) and void print() are declared public members' functions.
•t1.set("Scaler", "Academy"); sets the private member's string x as Scaler, y as Academy. These
implementation details are hidden from the user.
Execution of program
Above class adds numbers together, and returns the sum. The public members -
addNum and getTotal are the interfaces to the outside world and a user needs to know them
to use the class. The private member total is something that the user doesn't need to know
about, but is needed for the class to operate properly.
In the program above, you can see that we are not allowed to
directly access the variables x and y. But you can call the set()
function to set the values x and y. The display() function is
called to display the values x and y.