Time: 3 Hours Maximum Marks: 100 (Weightage: 75%) Note: Question No. 1 Is Compulsory and Carries 40 Marks. Attempt Any Three Questions From The Rest

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

No.

of Printed Pages : 3 B CS 031


- I
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)
05405 Term-End Examination

June, 2018

BCS-031 : PROGRAMMING IN C++

Time : 3 hours Maximum Marks : 100


(Weightage : 75%)
Note : Question no. 1 is compulsory and carries 40 marks.
Attempt any three questions from the rest.

1. (a) Define Abstraction and Encapsulation in


object oriented programming. Explain class
and object with the help of an example. 6

(b) What is polymorphism ? Explain its


advantages. Write a C++ program to
demonstrate polymorphism. 10

(c) Write a C++ program to find the sum of


two given numbers. 4

(d) What is a constructor ? Explain the


advantages of using constructors with the
help of an example. 5
BCS-031 1 P.T.O.
(e) What is a virtual function ? Write a
program in C++ to define a class "Teacher's
with a virtual function "Salary". Derive
class "Associate-Professor" from class
teacher and implement the salary function. 10

(f) What is encapsulation ? Are encapsulation


and information hiding the same ? Explain. 5

2. (a) Explain the different types of operators


available in C++. 10

(b) What is inheritance ? What are the


different types of inheritance supported
by C++ ? Explain how inheritance is
implemented in C++. 10

3. (a) Write a C++ program to define class


"Circle" and implement the following : 10
(i) a constructor

(ii) a member function to find area of a


circle

(iii) a member function to find


circumference of a circle

(b) How is function overloading implemented


in C++ ? Explain with an example
program. 10
BCS-031 2
4. (a) What is a friend function ? Explain how it
is implemented iii C++, with the help of an
example program. 10

(b) What is a template class ? Create a


template class for stack data structure. 10

5. (a) What are containers ? Explain the use of


,

List Container class with the help of an


example. 6

(b) What is an exception ? How is it handled in


C++ ? Explain it with the help of an
example. 6

(c) Explain the following with the help of an


example : 2x4=8
(i) Destructor
(ii) Inline function

BCS-031 3 6,000

You might also like