0% found this document useful (0 votes)
49 views4 pages

BCS 031

Uploaded by

sainiys2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
49 views4 pages

BCS 031

Uploaded by

sainiys2003
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

No.

of Printed Pages : 4 I BCS 031


-

BACHELOR OF COMPUTER APPLICATIONS


(BCA) (Revised)
Term-End Examination
1:316-7 44 O December, 2017

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) What do you mean by Abstraction and


Encapsulation ? How are the two terms
interrelated ? 4
(b) What is a Reference Variable ? What is its
usage ?
(c) Identify the errors in the following code
segment : 4
int main( )

cout « "Enter two numbers";


cin » num » auto;
float area = length * breadth;

BCS-031 1 P.T.O.
(d) Why will the function given in the
following code fragment not work ? What
should be done to make it work ?
int main( )

float sum (float, float);

void calc(void)

float x, y, s;

cin » x » y

s = sum (x, y);

(e) What is a Friend Function ? What is the


significance of friend functions ? 4
(f) What do you mean by Static Data Members
of a class ? Explain the characteristics of
static data members. 4
(g) What do you understand by a Default
Constructor ? How is a default constructor
equivalent to a constructor with default
arguments ? 4
BCS-031 2
(h) What is Function Overloading ? Compare
default arguments with function
overloading.
(i) When should one derive a class publicly or
privately ? Give a suitable example in
support of your answer.
(j) What are Iterators ? List the five types of
iterators supported by STL in C++. 4

2. (a) How does the functioning of a function


differ when
(i) an object is passed by value ?
(ii) an object is passed by reference ? 7
(b) What is Operator Overloading ? List the
operators which cannot be overloaded. Give
reasons behind it. 7
(c) What is 'this' Pointer ? Explain the
significance of 'this' pointer with the help of
an example. 6

3. (a) What is the difference between call-by-value


and call-by-reference in a user defined
function in C++ ? Give an example to
illustrate the difference. 10
(b) What is Message Passing ? Explain how
message passing is used in C++
programming with example. 10
BCS-031 3 P.T.O.
4. (a) What is the difference between overloading
and overriding concepts in C++ ? Explain
the usage of these concepts with suitable
example code in C++. 10

(b) What is an Exception in C++ ? Explain how


exception handling is done in C++ with the
help of a program. What will happen if
exception is thrown outside of a try block ?
Give reasons for such a happening. 10

5. (a) Write a program in C++ to create a class


Employee with basic data members such as
name, address, age. Create a class
Part_time employee which inherits from
the Employee class. Part_time class should
have a function to display the name,
address and payment of the part-time
employee. 10

(b) Write a program in C++ to simulate the


environment of a simple calculator. 10

BCS-031 4 15,000

You might also like