2023 2024 Student Forum > Management Forum > Main Forum

 
  #2  
13th May 2015, 09:50 AM
Super Moderator
 
Join Date: Apr 2013
Re: BPUT Oops Question

As you want I am here providing you sample Question paper of the Object Oriented Programming subject of the Biju Patnaik University of Technical Education (BPUT).

Sample paper :
BPUT OOPS paper
1, Identify whether the following statements are true or false. Justify your answer
in each case
2 X 10
a.A virtual base class is useful in C++ when the different methods in the base
and derived classes have the same name.
b. It is prudent to use the default destructors provided by the C++ language
rather than writing specified destructors for a class.
c. In C++ suppose you derive a class named manager from a class named
employee. Then you can assign an object of the manager class without
encountering any compilation error.
d. C++ classes can be considered as abstract data type (ADTs)
e. Deep class hierarchies are signs of an object oriented design done well.
f. The aggregation relationship among classes is symmetric.
g. The use of the inheritance features in an object oriented program result in
code reuse.
h. The aggregation relationship among classes can be considered to be a
special type of association relationship.
i. An object oriented program that does not derive new classes through
inheritance can not exhibit polymorphic behaviour through dynamic
binding.
2, Write C++ for the following description of the class / subclass :
10
Define an abstract base class “ Geomshape” that has the following
• Data members for the (x,y) coordinate position
• A constructer for initializing Geomshapes
• A virtual method ‘MoveShape()’
• A virtual method ‘PrintShape()’ to output an object
Derive subclasses ‘GeomLine’,’GeomCircle’, and ‘GeomTriangle’ from
‘GeomShape’ and ‘MoveShape()’ and ‘PrintShape()’ methods for each of the
sub-classes. You may assume appropriate data members for each of the
subclasses. You should use appropriate access controls in ‘GeomShape’.
5 X 2
3. a. An abstract class cannot have instances. What then is the use of having
abstract classes. Explain your answer using a suitable example.
b. What is the difference between method overloading & method overriding.
Explane your answer using a suitable example.
5 X 2
4. a. Explain why object oriented programs are more maintainable and reusable
compared to function oriented program.
b. Give the definition of a virtual base class C++ syntax. Explain why virtual base
classes are required.
5 X 2
5. a. What do you understand by exceptions in a C++ program. With an example
explain how exceptions are handled in a C++ program.
b. What do you mean by public, protected and private attributes of a class. Why
is this distinction among attributes necessary. Explain your answer using suitable
examples.
10
6. Consider a small student’s library. The library has a book catalog consisting of
100 issuable items. Each issuable item can either be a book or a periodical. The
issue methods of the books and periodicals override the issue method of the
issuable class. The member catalogue consists of 50 members. Each member is
either a teacher or student. When a book is issued, the member’s identity is
recorded in the book of objects. Also, the member object must record the book
issued to him. Once a book is returned, these associations are dissolved.
Represent your design using Booch’s notations. Write C++ code to implement
your design for the library system.
10
7. a. Explain the problem of the repeated inheritance. With the help of an
example explain how this problem can be overcome in C++.
b. Explain the following concepts and explain how they can be implemented in
C++ language by using suitable examples.
• Inheritance
• Composition
• Abstract Class
10
8. a. Write C++ code for the following description of the class “circle”. A C++
class named “circle” stores the co-ordinate position of the centre of a circle and
its radius as three floating point numbers. It supports the following methods :
• Circle:constructor method which initializes the centre & radius of the circle
during object creation.
• Print: displays the current centre and radius of the circle.
• Change: changes the center point and radius to the specified values.
b. Define the following overloaded operators.
• = = checks whether two circles are identical.
• = circle alignment.


Quick Reply
Your Username: Click here to log in

Message:
Options




All times are GMT +5. The time now is 09:00 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
SEO by vBSEO 3.6.0 PL2

1 2 3 4