M.C.A-M.C.A 2nd Sem IT 21 : 201 : OBJECT ORIENTED PROGRAMMING USING C++(University of Pune, Pune-2013)
M.C.A. (Management Faculty) (Semester - II) Examination, 2013
IT 21 : 201 : OBJECT ORIENTED PROGRAMMING USING C++
(2012 Pattern)
Time : 3 Hours Max. Marks : 70
Note : 1) Question No.1 is compulsory.
2) Solve any six from question no. 2 to 8.
3) Figures to the right indicate full marks.
1. Explain the output of following program :
a) namespace xyz
{
int x = 10 ;
}
void main ( )
{
int y = 200 ; int x = 100 ;
cout <<endl << "x⇒ " << x;
using namespace xyz;
cout << endl<< "x⇒ " << x;
cout <<endl<< "y=" << y;
}
b) void main ( )
{
int a,* b = &a;
int * * c = &b;
a=2;
* * c = 4;
b = (int* ) * * c;
cout <<"A=" <<a<<endl;
cout <<"B=" <<b;
}
c) void main ( )
{
cout << set w (10) << setfill ('#');
cout.setf (ios :: internal, ios :: adjustfield);
cout <<setiosflags (ios :: showpoint);
cout << setprecision(5);
cout <<11.432 <<endl;
cout << setiosflags (ios :: showpos);
cout << 15.4;
}
d) void main ( )
{
b001 b1, b2;
b2 = true;
int a = 10, b = 20;
b1=a=b;
b001 b3 = b1 || b2;
if (b3)
cout << "good";
else
cout << "very good";
}
2. A) Explain static member function and static data member. 5
B) Explain with example - Dynamic constructor. 5
3. A) Write a program to overload '+' operator to concatenate two strings. 5
B) Explain with example, conversion from class type to built in type. 5
4. A) What is user defined manipulator ? Write a single user defined manipulator to
provide following output specifications.
1) Column width 10
2) Right justification
3) Trailing zeros
B) Explain virtual function with suitable example.
5. Write a program that accepts the filename using command line arguments, and
counts number of characters, number of words and number of lines.
6. Write a program to pass parameters to the base class constructor in multilevel
inheritance.
7. A) Write a function template swap ( ) to swap two elements.
B) What is exception ? How certain exceptions are restricted in C++ ?
8. Write short notes on (any two) :
A) Standard Template Library (STL)
B) Namespaces.
C) Run Time Type Identification (RTTI).
————————
B/I/13/5275
Earning: ₹ 7.50/- |