How To Exam?

a knowledge trading engine...


Sardar Patel University 2008 B.E Computer Science CP312%E2%80%93 Object Oriented Programming%28Internal Test%29 - Question Paper

Tuesday, 29 January 2013 10:55Web

ADIT / BVM / GCET
Semester 2, A.Y. 2007-2008
Internal Test
CP312– Object oriented programming
Date: 10/03/2008 Time: 12.00noon – 1.00pm Max. Marks: 20

Q.1 Answer the subsequent ques..
1.) “Constructor can be described as private member function.”
Is above statement actual or False? Justify. [01]
2.) Which kinds of functions call are allowed for provided prototype declaration?
int sum(int a, int b=1, int c = 0); [01]
3.) Explain Inline function with example.
Or
discuss this pointer with example. [02]
4.) Explain new and delete.
Or
What type of ambiguities may arise in function overloading ? discuss any two. [02]

Q.2 Show the output of the subsequent programs. If there are errors, indicate them, accurate them and then show the output. presume needed header files are included. [04]
1.) class A
{ public:
A( ) { cout<<”Constructor \n”;}
A(A &o){cout<<”Copy constructor\n”;}
~A( ) {cout<<”Destructor\ n”;}
A fun(A a) {cout<<”Inside Function”; return(*this);}
};
void main()
{ A o1,o2;
A o3 = o2;
A o4 = o3.fun(o1);
o3 = o4;
}
2.) class B
{ int i;
public:
B(int n) { this.i = n; }
B(int k = 0) {i = k;}
void display() { cout<};
void main()
{
B ob(10);
ob.display();
}
Q.3
1.) Declare a class String. It must have constructor, which allow definition of objects in the subsequent form. (The class String has data member str of kind char *.)
String name1;
String name2 ( “Hello”);
String name3 = name2;
Write a program to overload + operator to concatenate 2 strings.
[05]

2.) Declare 2 classes called IT & CP having idno and CPI as private data members.
Overload > operator using friend function to compare CPI of 2 learner of various branch.

[05]


*************************




( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Sardar Patel University 2008 B.E Computer Science CP312%E2%80%93 Object Oriented Programming%28Internal Test%29 - Question Paper