Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
517 views

Object Oriented Programming With C++ Jan 2014

This document contains questions for an Object Oriented Programming exam with answers requiring 3 sentences or less. It covers key topics in OOP including: - Comparing structures in C to classes in C++. - Function overloading and writing a program to overload a function. - Private and public access specifiers in classes and writing a class with data members and member functions. - Friend functions, their characteristics, and writing a program using them. - Static and dynamic memory management. - Constructors, overloading constructors, and writing a program using them. - Inheritance forms in C++ and constructor invocation order in inheritance. - Virtual functions and pure virtual functions with examples.

Uploaded by

Prasad C M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
517 views

Object Oriented Programming With C++ Jan 2014

This document contains questions for an Object Oriented Programming exam with answers requiring 3 sentences or less. It covers key topics in OOP including: - Comparing structures in C to classes in C++. - Function overloading and writing a program to overload a function. - Private and public access specifiers in classes and writing a class with data members and member functions. - Friend functions, their characteristics, and writing a program using them. - Static and dynamic memory management. - Constructors, overloading constructors, and writing a program using them. - Inheritance forms in C++ and constructor invocation order in inheritance. - Virtual functions and pure virtual functions with examples.

Uploaded by

Prasad C M
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

06cs44

USN
Time: 3 hrs.
a.
b.
c.
3a.
Fourth Semester B.E. Degree Examinationo Dec.2013 lJan.20l4
Object Oriented Programming with G++
Note: Answer FIVEfull questions, selecting
at least TWO questions
from
each part.
Max. Marks:100
,
.r,":
.l
(04 Marks)
C)
(J
o
!
a
E
()
(.)
3e
6e
6
bol
troo
.=N
hoo
Y(]
og:
-o
o2
a:
oc)
50i
co(B
.G
4o
O!
tc
orv
o'j
6=
!o
=E
>'h
b0 --
go!
o=
go
tr>
o-
U<
J c.i
()
o
z
I a,.
b.
PART
_
A
With examples, compare between structures in C with classes in C++.
Write a function using reference variable as arguments to swap the values of a pair of
integers.
(04 Marks)
What is function overloading? Explain the advantages of overloading a function? Write a
program in C++ to overload the function mul(a, b) where a and.b are integers and floating
''
,i
(12 Marks) point numbers?
Explain the role ofprivate and public access specifiers in classes. Explain with an
ffifri?,
Write a program which creates a class called employee which consist of name, age, salary as
datamembers and read_data(
)
and put_data(
)
as
4ember
functions? Create a array of
objects which stores l0 employee's data.
(08 Marks)
What is a friend function? Why it is necessary? Explain the characteristics of a friend
b. Write a program to crate an array dynamically where the array size is specified during
function.
.....::
Explain the difference between
,,qtEtic
management.
(07 Marks)
memory management and dynamic memory
(05 Marks)
......:
(08 Marks)
(06 Marks)
(06 Marks)
c.
4a.
b.
c.
runtime.
r,,
'., (08 Marks)
What is a constructor? Exploin with an example, how to overload a constructor. (07 Marks)
What is inheritancef Expkin the different forms of inheritance supported by C++. (12 Marks)
Explain how the ordet.of constructor are invoked in inheritance with an example. (04 Marks)
What is a virtual base class? Explain with an example. (04 Marks)
5 a. What are virtual functions? Erplui, the rnechanism of virtuat funciion with an example.
PART
_
B
7 a. Explain with an example how the "new" and "delete" operator is
b. Demonstrate the overloading of
>
operator in C++ program.
8 a. Explain the four new-style casts supported by C++.
b. With an example, explain the try, throw and catch keywords
exception handling.
b.
c.
What is a pure virtual function? Explain its necessity with an example.
Explain the text versus binary files with an example.
6 a,. IiVhat is operator overloading? What are the operators that cannot be overloaded? What are
the rules for overloading operator? (06 Marks)
b. Write a C++ program to create a class called STRING and implement the following
operations. Display the results after every operator by overloading
<<.
i) String S1
:
"GOOD" ii) String 52: "LUCK" iii) String 53
:
Sl
c. Describe the following manipulators:
i) setw(
)
ii)setiosflags(
)
iii) setfill(
)
iv) reset
JWarks)
-r't
irgirr<sy
f
g6'r.9
,C/
)..o
.)11/-,--(I 0 Ma rks)
uset\#j$';lementing
(10 Marks)
For More Question Papers Visit - www.pediawikiblog.com
For More Question Papers Visit - www.pediawikiblog.com
w
w
w
.
p
e
d
i
a
w
i
k
i
b
l
o
g
.
c
o
m

You might also like