Sie sind auf Seite 1von 1

1). (a) What are the Three Pillars of OOPs. Explain them briefly.

(7)
(b) What are the features in Object Oriented Programming which were not available in Procedure
Oriented Programming? (7)
(c) What was the feature of OOPs which you as a learner found very interesting? (6)
--------------------------

2).(a) What are function Prototypes? Is it necessary to declare the function prototypes? (5)
(b) What is function overloading? What are the advantages of overloading a function?
Write a program in C++ to overload the function add(s1,s2) where s1 and s2 are integers. (10)
(c) What are the disadvantages of using Inline functions? (5)

3).(a) What is the relation between an Object and a Class? If we wrote a class and did not create
any objects, would the functions defined in the class be executed? Explain. (8)
(b) What is a constructor and destructor? When will they be called? Explain. (7)
(c) What is the advantage of using classes rather than using structures in C. (5)

4.a) What are the different forms of inheritance? Give example for them. (10)
b) Create an base class shape with two members base and height, a member function for
initialization and a pure virtual function to compute area ( ). Derive two specific classes Triangle
and Rectangle which override the function area ( ). Use these classes in a main function and
display the area of a triangle and a rectangle. (10)

5). (a) How would you say Polymorphism is beneficial? Explain with an example. (8)
(b) What are Templates and when should they be used? Explain with an example (8)
(c) What are the three blocks of Exception Handling? Explain briefly in words. (5)

6).(a) Write a program that takes in the total sale value as a screen input from the (10)
user. The program then calculates the agent's commission with the help of the
'IF-ELSE' command as follows :
5% if the total sale value is less than or equal to Rs10000
10% if the total sale value is less than or equal to Rs25000
20% if the total sale value is greater than Rs25000.It then outputs the agent's commission using
the 'cout' command.

(b) Write a simple C++ Program to find the area and perimeter of a rectangle using classes,
constructor, destructor, area ( ) function and any other functions you may require. (10)

Das könnte Ihnen auch gefallen