OOP-Paradigm with C++
OOP-Paradigm with C++
A. COURSE OUTCOMES
▪ CO.1: Revised the basics of Programming concepts like structured, unstructured & Object-oriented
programming concepts..
▪ CO2: Understand the difference between C & C++ programming structure, logics with and without
OOP.
▪ CO3: Implement the OOP concepts as practical like Polymorphisms, Inheritance, and DMA etc.
▪ CO.4 Apply OOP concepts and their syntax like Class objects, Constructor, Polymorphism, inheritance,
and DMA
▪ CO.5 Design the UML Diagrams, Classes and Objects with OOP concepts
▪ CO.6 Evaluating the performance and difference of various concepts and logics of OOP with respect to
the problem domain.
B. ASSESSMENT TOOLS:
3 Project Based Learning Assignment (Group of 3-4 students) CO3, CO5, CO6
2 Classes and Objects: Simple classes (Class specification, class Audio/Video clips, group
members accessing), Defining member functions, passing object as discussion, lecture with
PPT and using online
an argument, Returning object from functions, friend classes, Pointer
and offline C++
to object, Array of pointer to object complier
5 Templates: Introduction, Function Template and examples, Class Audio/Video clips, group
Template and examples. discussion, lecture with
ppt, quiz and using
online and offline C++
Working with Files: Introduction, File Operations, Various File complier
Modes, File Pointer and their Manipulation
D. Text Book:
S. No. Author Title Edition
1. E. Balagursamy Object Oriented Programming with
C++;
2 R. Lafore Object Oriented Programming in
C++
E. Reference Books:
S. No. Author Title Edition
1 Herbert Schildt C++ The Complete Reference
2 Bjarne stroustrup , The C++ programming Language 4th edition
Practical Lab:
1 Write separate functions to swap 2 integers making use of (i) pointer parameters and (ii) reference
parameters (iii) constant data member
2 Create a class called Counter that contains a static data member to count the number of Counter objects
being created. Also define a static member function called showCount() which displays the number of
objects created at any given point of time. Which displays the number of objects created at any given point
of time.
3 Define a class to represent a Bank account. Include the following members.
a. Data members:-
b. Name of the depositor
c. Account number.
d. Type of account.
e. Balance amount in the account.
f. Rate of interest (static data)
4 Provide a default constructor, a parameterized constructor and a copy constructor to this class.
a. Also provide Member Functions:-
1.To deposit amount.
2.To withdraw amount after checking for minimum balance.
3.To display all the details of an account holder.
4.Display rate of interest (a static function)
Illustrate all the constructors as well as all the methods by defining objects.
1. a. Define a class named Movie. Include private fields for the title, year, and name of the director.
Include three public functions with the prototypes
1. void Movie::setTitle(char [ ]);
2. void Movie::setYear(int);
3. void Movie::setDirector(char [ ]);
Include another function that displays all the information about a Movie.
b. Include a function which accepts 2 objects of type Movie and displays whether or not they were
released in the same year and also whether the Directors are same. String functions may be used.
5 Write an overloaded function called compute Area which is used to compute the area of a triangle, a
rectangle and a circle, respectively. Show the invocation of these functions in the main.
6 Create 2 classes namely Rectangle and Circle with suitable data members. Provide member functions
namely input and display to these classes. Function input is for inputting the dimensions and calculating
the area. The area should be stored along with the input data members. Function display is for displaying
the dimensions as well as area. Write a friend function (called larger) of class Rectangle and class Circle
which compares the areas of the rectangle object with a circle object and displays which one is greater.
7 Write a C++ class that contains two classes’ car and track. The car class contains two private variables
passengers and speed. The track class contains two private variables load and speed. Use friend function
to compare the speed of car and track.
8 Define a class called Customer that holds private fields for a customer ID number, name and credit limit.
Include public functions that set each of the three fields and also for displaying a customer’s data.
9 Write a main() function that declares an array of 5 Customer objects. Prompt the user for values for
each Customer, and display all 5 Customer objects.
10 Create a base class called Shape. Use this class to store 2 double type values which could be used to
compute the area of figures. Derive 2 specific classes called Triangle and Rectangle from the base class
Shape. Add to the base class, a member function called GetData to initialize base class data members and
another member function displayArea to compute and display the area of figures. Make displayArea a
virtual function and redefine this function in the derived classes to suit their requirements. Using these
three classes design a program which will accept dimensions of a triangle or rectangle interactively and
display the area.
11 Write a Program to implement a Queue stack operation using DMA.
12 Design a template Stack which can work with either a Student record or an Employee record. A Student
record contains name, rollNo and cgpa. An Employee record contains name, empId and salary fields.
Provide push, pop, display functions to the template stack class.
13 Write a class template to represent a generic vector. Include member functions to perform the following
tasks:
1) To create the vector.
2) To modify the value of a given element.
3) To multiply the vector by a scalar value.
4) To display the vector in the form (10, 20, 30
14 A file contains a list of names and telephone numbers in the following form:
Name Tel. No.
Write a C++ program to read the file and output the list in the tabular format. The
name should be left-justified and numbers right-justified. Use a class object to store each set of
data. Program should also perform following tasks.
i) To determine the telephone numbers of the specified person.
ii) To determine the name if a telephone number is given.