You are on page 1of 2

SCAD ENGINEERING COLLEGE DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Sub. Code / Sub. Name Academic Year Batch : CS59 /Object Oriented Programming : 2011 -2012(Odd Semester) : 2009-2013

Course Teacher : Mrs.C.Anuradha

Unit II Part B

Operator overloading and Friend Functions


List out the rules for overloading operators with example. Explain about Unary Operator and Binary Operator overloading with program. Write a C++ program to implement complex number addition, subtraction and multiplication using binary operator overloading. Write a C++ program to overload + operator to add two matrices. Define friend class and friend function. Explain each with example. What do you mean by function overloading? Discuss when we use this concept. Write a program for overloading the assignment operators How to achieve operator overloading through friend function? Write a program using friends function for overloading << and >> operators. Perform the following operation using operator overloading Voltage 1 = Voltage 2 + Voltage 3

Type conversion
Define basic to class type conversion with an example. Define class to basic type conversion with an example. Define one class to another class conversion with an example.

Templates
Explain the Function template Explain the Class template

Inheritance
What are the different forms of inheritance supported in C++? Discuss on the visibility of base class members in privately and publicly inherited classes.

Virtual Functions & Runtime Polymorphism


Define the polymorphism. Explain the different types of polymorphism.

What are the virtual functions? Explain their needs using a suitable example. What are the rules associated with virtual functions? Explain virtual functions with an example. What are abstract classes? Give an example (with the program) to illustrate the use of abstract classes. Describe virtual class and virtual functions.

You might also like