Object Oriented Programming with C++.pdf - Google Drive

0 downloads 132 Views 1MB Size Report
Write a C++ program to perform the addition of two location objects by overloading '+'. operator, using a class "LOCATIO
For More Question Papers Visit - www.pediawikiblog.com 10CS36

I.]SN ..tr4r'

Third Semester B.E. Degree Ex

une/July 2g16

Object Oriented Programm ng With G++ Max. Marks: !.00

Time: 3 hrs.

b.

c'

(06 Marks) Explain any three features of object oriented programming. What is function overloading? Write a C++ program to define three overloaded functior-rs to find the sum of two integers, sum of two floating point numbers and sum of three integers.

What are inline functions? Illustrate inline functions with an examptre.

a)

(oo .= (d$at xa0

b.

oB

3 a.

tso oc ao *,a

b.

o() dO

constructors.

What are friend functions? Write a C+r program to find the sum of two cornplex numbers (10 Marks) using friend functions. Write a C++ program to perform the addition of two location objects by overloading '+' operator, using a class "LOCATION" with the data members longitude and latitude. Read (10 Marks) and display the location objects by overloading the operators >.

2u

b.

aA tro.-i

6=

6,i

Write

a

b. c.

(10 Marks)

C++ program to illustrate multiple inheritance and multilevel inheritance. (10 Marks)

PART _ B

Illustrate with a C+* program the execution of constructors and destructors when single (06 Marks) inheritance is involved. passing parameters Explain of to base class constructors in multiple inheritance. (08 Marks) Explain the need for virtual base classes. (06 Marks)

w w

ce LO o.=

5 a.

i) Public ii) Private iii) Protected. Illustrate the same with a program.

.p

o

Explain the visibility of the base class members for the access specifiers:

ed

4 a.

/6

ia

b0i

!s= E6

students.

(10 Marks) Use the above specification to read and print the information of 5 program to What are constructors? Explain the different types of constructors. Write a C++ (10 Marks) iilustrate the different types of

ib

oo

ik

dU -o

m::

Define class and objects. Write a C++ program to create a class STUDENT with the following specifications. Data members: Name, Roll No. and Average Marks Member functions: Read & Write

lo

2 a.

(08 Marks) (06 Marks)

w

I

E9

m

la.

co

o o

g.

0)

Note: Answer FIVE full questioms, selecting at leust TWO quntiirnt from each purt. PART _ A

>'! boe

c50

o- :\ =o 5:

u