punjabtechnicaluniversity.blogspot.in
Roll No. .................
Total No. of Questions : 13] [Total
No. of Pages : 02
Paper ID [A0507]
(Please fill this Paper ID in OMR Sheet)
MCA (202) (Old / S05) (Sem. - 2nd)
OBJECT ORIENTED PROGRAMMING IN C++
Time : 03 Hours Maximum
Marks : 75
Instruction to Candidates:
1) Section - A is Compulsory.
2) Attempt any Nine questions from Section - B.
Section - A
(15 x 2 = 30)
Q1)
a) For a two dimensional array int a [2][2],
which element is represented by *(a + 1).
b) Differentiate between macros and
functions?
c) When should one use references, and when
should I use pointers?
d) Explain Function overloading with simple
examples.
e) Can I overload the destructor for my
class? Support your answer.
f) What do you mean by new and delete
operator?
g) What’s the order that local objects are
destructed?
h) What is the significance of access
specifiers in a class?
i) Explain the role of file iostream.h in
C++.
j) Explain the difference between prefix and
postfix incremental operator.
k) Write a declarator for main( ) that will
enable command line arguments.
l) True or False: A file pointer always
contains the address of the file.
m) Explain the use of this pointer.
n) Write a declarator for a pure virtual
function called purevar( ) that returns type void and takes one argument of
type int.
o) What are some advantages/disadvantages of
using friend functions?
Section - B
(9 x 5 = 45)
Q2) When do we make a virtual function “public”?
What are the implications of making a function pure virtual function?
Q3) Bring out the difference between classes and
structures in C++.
Q4) What is pointer arithmetic? How is it
performed? Support your answer with an example.
Q5) Neatly explain constructor and destructor
with suitable examples.
Q6) What are the file manipulation operations
supported by C++? Explain.
Q7) Write a C++ Program to count the number of
words in a given file. Note the words could be separated by single or multiple
white spaces (white space is a blank space or a tab or a new line).
Q8) What is the difference between Static binding
and Run time binding? Explain
with a suitable C++ code.
Q9) Explain with the help of suitable example the
difference between function
overloading and function over-riding.
Q10)What is a template? List the merits and
demerits of using a template in C++.
Q11)Write short note on Multilevel and Multiple
inheritance.
Q12)Explain with example about constructor
overloading in C++.
Q13)Write a program to reverse a string using
recursion.
0 comments:
Post a Comment
North India Campus