OOPS
OOPS
Credit Units: 4
Course Level: UG TOTAL
Course Code: ES203 T P/S SW/FW CREDIT
L
UNITS
Course Objectives: 3 0 2 0 4
1) Get introduction of object-oriented programming.
2) Explore and implement the various features of OOP such as inheritance, polymorphism, Exceptional handling etc. using programming language C++. To easily
identify the basic difference between the programming approaches like procedural and object oriented
Course Contents/Syllabus:
Weightage (%)
Module I Introduction
Descriptors/Topics
• Difference between C and C++
• Procedure Oriented and Object-Oriented Approach
• Basic Concepts: Objects, classes, Principals like Abstraction, Encapsulation, Inheritance and Polymorphism. Dynamic
Binding, Message Passing
• Characteristics of Object-Oriented Languages 10
Theory
Components (Drop Mid Term Exam Home Assignment Attendance Quiz End Term
down) Examination
Weightage (%)
15% 10% 5% 10% 60%
LIST OF PRACTICALS
1. Write a program to check number palindrome and string palindrome.
2. Write a program to show the effect of call by value and call by reference in functions.
3. Write a program to perform following operations on matrix using functions and switch case:
(a) Addition (b) subtraction (c) multiplication (d) transpose
4. Define a class Shape whose attributes are radius, length and width calculate the perimeter of the rectangle and circle. Use constructors and destructors.
5. Create a class Person which includes: character array name of size 64, age in numeric, character array address of size 64, and total salary in real numbers
(divide salary in different components, if required). Make an array of objects of class Person of size 10.
(a) Write inline function that obtains the youngest and eldest age of a person from a class person using arrays.
(b) Write a program to develop the salary slip and display result by using constructors.
6. Create a class called Complex for performing following operations:
(a) Overload increment and decrement operators for increasing and decreasing complex number values (Unary operator overload).
(b) Overload ‘+’ op and ‘-‘op for complex numbers (Binary operator overloading).
7. Write a program to find the area (function name AREA) of circle, rectangle and triangle by Function overloading concept.
8. Design three classes: Student, Exam and Result. The student class has data members such as roll no, name etc. Create a class Exam by inheriting the
Student class. The Exam class adds data members representing the marks scored in six subjects. Derive the Result from class Exam and it has its own
members such as total marks. Write an interactive program to model this relationship. What type of inheritance this model belongs to?
9. Write a program to swap two numbers (create two classes) by using Friend function.
10. Consider an example of book shop which sells books and video tapes. These two classes are inherited from base class called media. The media class has
command data members such as title and publication. The book class has data members for storing number of pages in a book and tape class has playing
time in a tape. Each class will have member functions such as read () and show (). In the base class, these members have to be defined as virtual functions.
Write a program to models the class hierarchy for book shop and processes objects of these classes using pointers to base class. Write the rules of virtual
functions.
11. Write a program to calculate the total mark of a student using the concept of virtual base class.
12. Write a program to show the use of this pointer. Write the application of this pointer.
13. Write a program to implement stack functions using templates.
14. Write a program to demonstrate exception handling
15. Write a program that input a file, which determines its length. Also count the number of word occurrence. For example:” that person is going to town to
meet other person”. Here “to” and “person”-2times.