How To Exam?

a knowledge trading engine...


Punjab Technical University 2010-4th Sem B.Sc BioInformatics (BI) (th) OBJECT ORIENTED PROGRAMMING USING C++ - Question Paper

Tuesday, 09 April 2013 09:25Web



Total No. of Questions : 12]    [Total No. of Pages : 03

Roll No.......................

J-3261[S-1117]    [2037] B.Sc. (BI) (Semester - 2nd/4th) OBJECT ORIENTED PROGRAMMING USING C++

(B.Sc.(BI) - 402/205)

Time : 03 Hours    Maximum Marks : 75

Instruction to Candidates:

1)    Section - A is compulsory.

2)    Attempt any Nine questions from Section - B.

Section - A

Q1)

a)    Distinguish between the following terms :-    [2 x 4]

(i)    Object and classes

(ii)    Data abstraction and data encapsulation

(iii)    Inheritance and data encapsulation

(iv)    Dynamic binding and message passing

b)    Describe the major parts of a C++ program.    [2]

c)    Un an unsigned Int can be twice as large as the signed Int. Explain how?[2]

d)    What is a reference variable? What is its major use?    [2]

e)    How does an inline function differ from a preprocessor array? [2]

f)    How is a member function of a class defined?    [2]

g)    How do we invoke a constructor function?    [2]

h)    Describe the importance of destructors.    [2]

i)    How many arguments are required in the definition of an overloaded unary operator?    [2]

j) What does THIS pointer point to?    [2]

k) What is a virtual function?    [2]

1) When do we make a virtual function pure? What are the implications of making a function a pure virtual function?    [2]

Q2) Design a linked list base class. Implement all its possible methods and data structures. Through inheritance mechanism create two more subclasses namely stack and queue class. Implement its data structures and important methods. Observe the following while designing classes :

   Clearly indicate public and private class

   Use pointers to implement classes

   Design constructors in each class and explain its purpose

   Identify data structures and methods which can be inherited

   Implementation should be in C++

Q3) Use the above example to illustrate the main advantages offered as compared to conventional data type.

Q4) Generalize your definition of stack to define it as a template class.

Q5) Print out which statements in the following C++ code fragment violate the access control mechanism for class X or class Y

class X {private : int i; void pvt_X(); protected : int j; void prot_X(); public : int K; void pub_X(int, int);};

class Y : public X {char C; }; X x; Y y; x.i=10; x.K = 15; y.prot_X(); y.pub_X(5, 10);};

Q6) Describe the following concepts through examples:

(a)    Generalization

(b)    Aggregation

(c)    Multiple inheritance

(d)    Metadata

Q7) Prepare an object diagram for a graphical document editor that supports grouping which is a concept used in a variety of graphical editors. Assume that a document is composed of several sheets, each sheet contains drawing objects, including text, geometrical objects and graphs. A group must contain at least two drawing objects which can be a direct member of at most one group. Geometrical objects include circle, ellipse, rectangle, line and square.

Q8) Explain the notion of in line and friend functions in C++ through example.

Q9) In C++ what happens if a constructor or destructor assigns a value to the pointer this? Explain what precautions must be taken when writing such a constructor to ensure that it can correctly initialize both free store and automatic objects.

Q10) C++ supports virtual destructor but not virtual instructors. Give an example to show the use of virtual destructor. Justify the absence of virtual constructors in C++.

Q11) Give an example to explain the notion of virtual base class in C++. Illustrate what happens to your example when the base class is not declared as virtual?

Q12) Comment on the importance of data persistence. What are different approaches to providing persistent data services?

nnnn

J-3261[S-I117]    -3-







Attachment:

( 0 Votes )

Add comment


Security code
Refresh

Earning:   Approval pending.
You are here: PAPER Punjab Technical University 2010-4th Sem B.Sc BioInformatics (BI) (th) OBJECT ORIENTED PROGRAMMING USING C++ - Question Paper