How To Exam?

a knowledge trading engine...


Punjab University 2011-2nd Year B.C.A Computer Application Object Oriented Programming (Using C++), : - Question Paper

Tuesday, 07 May 2013 10:10Web

Questions:9 Roll No. ................
Sub Code:0895 Exam. Code:121

BCA-2nd Year
2041
OBJECT ORIENTED PROGRAMMING (Using C++)

Time Allowed: 3 Hours Maximum Marks:90

Note:- Attempt total 5 ques..Section A is compulsory and attempt
at lowest 1 ques. from every parts B, C, D and E.

SECTION-A

1. (a) What is a main() function ? How it is various from other
functions ?

(b) What is difference ranging from the subsequent 2 declarations ?

extern int m;
int m = 0;

(c) When the subsequent code is executed, what will be the values
of x and y ?

int x = 1, y = 0;
y = x++;

(d) What are the new and delete ?

(e) What is the primary purpose of C++ union kinds ?

(f) What is a default constructor ?

(g) When do we use default parameters in a function definition ?

(h) If p is pointer of kind int and q is a pointer of kind float, state
which of the subsequent statements are legal.

(i) p = int *(q);
(ii) p = (int*) q;
(iii) p = int (*q);
(iv) p = (int*) (q);
(v) *p = 25, *q = 7.5, *p = *p + *q;

(i) What is the difference ranging from overloading and overriding ?[Marks 18]

SECTION-B

2. (a) What is a procedure-oriented programming ? elaborate its
main characteristics ?

(b) Distinguish ranging from the following:

(i) Object-oriented approach and object-based approach
(ii) Objects and classes
(iii) Data abstraction and encapsulation
(iv) Classes and structures
(v) Dynamic binding and message passing.[Marks 8,10=18]

3. (a) What are friend functions and its advantages ? elaborate their
implications on info hiding ?

(b) Write a macro that finds the largest of the 3 numbers.[Marks 10,8=18]

SECTION-C

4. Create 2 classes DM and DB which stores the value of distances.DM stores distances
in meters and centimeters and DB in feet and inches. Write a program that can learn
values for the class objects and add 1 object of DM with a different object of DB.
Use a friend function to carry out the addition operation. The object that stores the
result may be a DM object or DB object, depending on the units in which the outcomes
are needed.
The display should be in the format of feet and inches or meters and centimeters
depending on the object on display.[Marks 18]

5. What are constructors and destructors ? Can a parameterized constructor
be a default constructor ? define the copy constructor with the help
of program in C++.[Marks 18]

SECTION-D

6. (a) What is operator overloading ? Why is it necessary to overload
an operator ?[Marks 8]

(b) What does inheritance mean in C++ ? When do we use the protected
visibility specifier to a class member ? discuss with an example.[Marks 10]

7. (a) What is conversion function ? How it is created ? discuss
its syntax.[Marks 10]

(b) What are the advantages of friend function ? A friend function
cannot be used to overload the assignment operator =. discuss
why.[Marks 8]

SECTION-E

8. Explain the various kinds of Input/Output functions available in
C++ ? How are they accessed ?[Marks 18]

9. (a) Define polymorphism. How is polymorphism achieved at compile
time and run time ?[Marks 10]

(b) Explain with a C++ program how to create space for an array
of objects using pointers ?[Marks 8]



( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Punjab University 2011-2nd Year B.C.A Computer Application Object Oriented Programming (Using C++), : - Question Paper