0% found this document useful (0 votes)
8 views

BCS 031 June2010 June2023 IGNOUAssignmentGuru - Com 1

Uploaded by

anirudhfea143
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

BCS 031 June2010 June2023 IGNOUAssignmentGuru - Com 1

Uploaded by

anirudhfea143
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 76

No.

of Printed Pages : 3 BCS-031


DIPLOMA IN CIVIL ENGINEERING

om
Term-End Examination
December, 2012
O

c
O
BCS-031 : PROGRAMMING IN C++

ru.
Time : 2 hours Maximum Marks : 100
(Weightage 75%)

u
Note : Question number 1 is compulsory and carries 40 marks.

1.
tG
Attempt any three questions from the rest.

(a) Explain features of structured programming 6


en
paradigm in brief. Also list its advantages
and disadvantages with respect to Object
Oriented Paradigm.
nm

(b) What is encapsulation ? Explain how it is 8


different from information hiding with the
help of an example program to manage
sig

Books issue and return in a Library.


(c) What is data type ? List any four built in 6
data types and their size in C++. Also
explain need of derived data type in C++
As

programming.
(d) What is an object ? Explain how objects in 8
C++ are created and destroyed, with the
OU

help of program to create Bank-Account


Class, having data members name, account-
number, balance and member function
IGN

display balance.

BCS-031 1 P.T.O.
(e) Explain the concept of copy constructor 6
with the help of an example program.

om
(f) What is function template ? Write a
function template SUM to add two
numbers.

c
ru.
2. (a) Write a program in C++, which take two 10
3 x 3 matrices as input and find sum of them.

u
Implement suitable constructor and
destructor for this program.

tG
(b) What is message passing ? Explain how 10
message passing is used in C++
en
programming with an example.
nm

3. (a) What is access control specifier ? Explain 5


the need of different access control specifiers
with example.
sig

(b) What is constructor ? Explain advantage 5


of constructor with the help of an example.
As

(c) Write a C++ program to create a class Book, 10


to keep the records of books available in
your library. This program should have
OU

proper constructor and member functions,


to get the details such as publisher, author
and price etc. of the books. Make necessary
IGN

assumptions where ever required.

BCS-031 2
4. (a) Explain need of operator overloading. Also 10
explain why some operators can not be

m
overloaded ? Write a C++ program to
overload '+' operator to add two character

.co
strings.
(b) What is data stream ? Explain stream 5
hierarchy in C++.

uru
(c) What is friend function ? Explain its 5
advantage with the help of an example.

5.
tG
(a) What is polymorphism ? Explain advantage 10
of polymorphism. Also write a C++
program to explain use of virtual function.
en
(b) What is exception ? Explain how exception 10
handling is done in C++ with the help of a
nm

program. Also describe what will happen if


an exception is thrown out side of a try
block and why ?
sig
As
OU
IGN

B CS-031 3
No. of Printed Pages : 3 B CS-031

m
BACHELOR OF COMPUTER APPLICATIONS
(Revised)

.co
Term-End Examination
O
June, 2013
O

uru
BCS-031 : PROGRAMMING IN C++
Time : 3 hours Maximum Marks : 100
(Weightage 75%)

tG
Note : Question number 1 is compulsory and carries 40 marks.
Attempt any three questions from the rest.
en
1. (a) What is object - oriented programming 6
paradigm ? Explain advantages of object -
oriented programming paradigm over
m

structured programming paradigm.


(b) Write a C++ program to create a class 10
gn

NUMBER with a constructor to initialize


object of NUMBER class with three integer
data values. Define a function largest to find
si

the largest number among the three member


data.
As

(c) What is need of memory management in 5


C++ programming ? Explain in brief about
memory management process in C++.
OU

(d) What is a virtual function ? Write a 8


program in C++ to create class Doctor with
a virtual function salary. Derive class
IGN

Visiting - Doctor and implement function


salary in it.

BCS-031 1 P.T.O.
(e) What is operator overloading ? Briefly 6
explain general rules of operator

m
overloading.
(f) What is stream manipulator ? Explain use 5

.co
of setw( ) and setprecision( ) as stream
manipulator.

uru
2. (a) Differentiate C++ programming language 5
from C programming language in terms of
parameter passing in functions..
(b)
types in C++. tG
What is data type ? Draw hierarchy of data 5
en
(c) Write a C++ program to implement simple 10
calculator to perform '+, —, *, /' on two
m

integer operands. Your program should


have methods for reading data and for
performing arithmetical operations.
gn

3. (a) Write a C++ program to open an existing 10


si

file and insert the text "My C++ File" at the


end of it.
As

(b) What is reusability of code ? Write a C++ 10


program to create a class student, with basic
OU

data members such as name, address, age.


Create a class PG_student by inheriting from
student class. PG_student class should have
IGN

a function to display, name, address, subject


of the student.

BCS-031 2
4. (a) What is need of exception handling in C++ 10
programming ? Explain with an example

m
how exceptions are handled in C++. Briefly
describe the hierarchy of exception classes

.co
in C++ standard library.
(b) What is template class ? Explain advantages 10
of template class. Create a template class

uru
for Linked - List data structure.

5. (a) What is function overloading ? How it is 10

tG
different from function overriding ? Explain
with an example of each.
(b) How function calls are matched with 10
en
overloaded functions in C++ ? Explain with
the help of a C++ Program.
m
si gn
As
OU
IGN

BCS-031 3
No. of Printed Pages : 2 BCS-031

m
BACHELOR OF COMPUTER APPLICATIONS
(Revised)

.co
Term-End Examination
December, 2013

uru
BCS-031 : PROGRAMMING IN C++
Time : 3 hours Maximum Marks : 100
(Weiglitage 75%)

tG
Note : Question number 1 is compulsory and carries 40 marks.
Attempt any three questions from the rest.
en
1. (a) Explain the basic characteristics of object 6
oriented programming (OOP). Also explain
nm

any three advantages of OOP over


procedural programming languages.
(b) What is an operator ? List the various types 8
of operators used in C++.
sig

(c) What is meant by object initialization ? 6


What is its need ? Explain with the help of
a suitable examples.
As

(d) What are friend functions ? Explain two


8
merits and two demerits of using friend
OU

functions, with the help of an example.


(e) What is slope resolution operator ? Explain 6
its use with the help of a C++ program.
IGN

(f) What is virtual function ? Explain 6


advantage of using virtual function in C++,
with the help of an example.

BCS-031 1 P.T.O.
2. (a) What is exception handling ? How is it 10

m
performed in C++ ? Explain with the help
of an example.

.co
(b) Write an object oriented program in C++ to 10
read a set of integer numbers. Upto n, where
n is defined by the user and print the

uru
contents of the array in the reverse order
using a class template.

3. (a) Write a program in C++ to find the largest 10

tG
of any three numbers using a member
function defined in a class.
(b) What is static member ? Explain use of static 10
en
data member and static member function
with the help of an example program in
nm

C++.

4. (a) List the merits and demerits of single 5


inheritance over multiple inheritance.
sig

(b) What is polymorphism ? Explain any three 5


advantages of polymorphism.
(c) What is container ? List main types of 10
As

container in C++. Also list some common


member functions of container classes.
OU

5. Write short note on the followings : 4x5=20


(a) Abstract classes
(b) Input and output streams
IGN

(c) Operator overloading


(d) Class and objects

BCS-031 2
No. of Printed Pages : 2 BCS-031
BACHELOR OF COMPUTER APPLICATIONS

m
(Revised)

.co
Term-End Examination

O June, 2014

uru
BCS-031 : PROGRAMMING IN C++
Time : 3 hours Maximum Marks : 100
(Weightage 75%)
Note : Question number 1 is compulsory and carries 40 marks.

tG
Attempt any three questions from the rest.
en
1. (a) Explain the basic characteristics of object 8
oriented languages. How is object oriented
programming language better than
nm

structured programming language ?


(b) What do you mean by copy constructor ? 6
Explain it with a suitable C++ program.

(c) What is meant by comparison and logical 8


sig

operators ? How are they different from the


arithmetic and assignment operators,
explain with the help of an example.
As

(d) Explain function template with the help of 6


an example.
(e) What is looping in C++ ? What are the 6
OU

advantages of using loops in C++ ? Also


list the various looping options available in
C++.
(f) What is a structure in C++, and how a 6
IGN

structure is different from a class ? Explain


with example.

BCS-031 1 P.T.O.
2. (a) What is exception handling ? What are the 10
keywords used to handle the exception in

m
C++ ? Write a C++ program to handle
divide by zero exception.
(b) Write a program in C++ using operator 10

.co
template for the binary numbers to perform
a simple arithmetic operations such as add
and subtract.

uru
3. (a) Write a program in C++ that prints 10
numbers and its cubes from 1 to 10 by using
if-then-else and for loop.
(b) Explain the use of continue statement in C++, 5

tG
with example.
(c) Explain how setting of field width and 5
setting of precision may be done in C++.
en
4. (a) Write a C++ program to create vehicle class 10
and derive Car, Truck and Bike classes from
nm

the Vehicle class. Also define proper


constructors for each of these classes.
(b) Explain the concept of virtual function with 5
the help of an example.
sig

(c) What are access control specifiers ? Explain 5


difference between private and public access
control specifiers.
As

5. Write short note on the following : 4x5=20


(a) Encapsulation
(b) Message Passing
OU

(c) Function Overloading


(d) File pointers and operations.
IGN

BCS-031 2
No. of Printed Pages : 3 BCS-031

m
BACHELOR OF COMPUTER APPLICATIONS
(Revised)

co
Term-End Examination
00074 December, 2014

.
BCS-031 : PROGRAMMING IN C ++

uru
Time : 3 hours Maximum Marks : 100
(Weightage 75%)
Note : Question no. 1 is compulsory and carries 40

tG
marks. Attempt any three questions from the rest.
en
1. (a) Why did people change over from
structured programming to object-oriented
nm

programming ? Explain it in brief with the


help of an example. 6
(b) • Write C++ program to find factorial of a
given number using copy constructor. 8
sig

(c) What do you mean by inline function ?


What is its importance in object-oriented
programming languages. Write C++
As

program to clarify the concept of inline


function. 8
(d) Differentiate class template and function
OU

template with the help of an example. 8


(e) Write C++ program to implement
multilevel inheritance. Provide the
IGN

necessary comments to clarify the


availability of data members and member
functions in different classes. 5
BCS-031 1 P.T.O.
(f) What is an object in C++ ? Explain how an

m
object can be passed as an argument to a
function with the help of an example.

co
2. (a) What do you mean by constructors ? Write
the characteristics of constructors. Write a

.
program to illustrate the use of constructor

uru
in C++ programming. 10
(b) What happens if we don't use the virtual
function in the inheritance ? Explain the

tG
importance of virtual function in the
reference of the above, with the help of an
example. 10
en
3. (a) What are the needs of operator overloading
in the program ? Why can't some operators
nm

be overloaded ? Write C++ program to add


two complex numbers using plus (+)
operator overloading. 10
sig

(b) Why does abstract class play an important


role in object-oriented programming ?
Write C++ program of abstract class which
As

uses the concept of pure virtual function. 10


OU

4. (a) What do you mean by polymorphism ? How


is run time polymorphism different from
compile time polymorphism ? Give
example(s) to support the above
IGN

differentiation. 10

BCS-031 2
(b) What do you mean by the file stream

m
operations ? Write C++ program to
demonstrate the reading from disk file and
writing the result to the disk file.

co
(c) What is friend function ? Explain its
concept with the help of a suitable

.
example. 3

uru
5. (a) Describe all types of containers that are
available in C++ with their importance, in

tG
detail. 10

(b) Explain a situation when you will use


en
multiple catch statements in a C++
program for exception handling. 5
nm

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


circle.
sig
As
OU
IGN

BCS-031 3 9,000
No. of Printed Pages : 3 I BCS 031
-

m
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)

.co
Term-End Examination
June, 2015
05723 .

uru
BCS-031 : PROGRAMMING IN C ++
Time : 3 hours Maximum Marks : 100
(Weightage 75%)

ntG
Note : Question no. 1 is compulsory and carries 40
marks. Attempt any three questions from the rest.
me
1. (a) Explain object oriented concepts. How is
object oriented language different from
structured programming language ? 8
(b) What is inheritance ? Explain different
ign

types of inheritance supported by C++. 6


(c) Differentiate between default constructor
and parameterized constructor with the
ss

help of an example.
(d) What is an abstract class ? How do you
create an abstract class ? What is the
UA

purpose of creating an abstract class in


object oriented programming paradigm ?
Explain with the help of an example. 8
NO

(e) Write a C++ program to add two complex


numbers. In this program you need to
create complex class and define proper
constructor for object initialization. 10
IG

BCS-031 1 P.T.O.
2. (a) What do you understand by friend
function ? Write a C++ program to find out

m
the sum of n given numbers using friend
function. 10

.co
(b) Explain the difference between private,
protected and public access specifier with
respect to class and its object. Write a

uru
program in this support. 10

3. (a) What do you mean by

ntG
operator-overloading ? List the operators
which cannot be overloaded. Write a C++
program for unary minus (-) operator
overloading. 10
me
(b) Explain the concept of virtual function with
its important characteristics. Write a C++
program to illustrate the importance of
ign

pure virtual function. 10

4. (a) What do you mean by this pointer ? Explain


ss

the use of this pointer with the help of an


example. 5
UA

(b) Write a C++ program to display the


price-list of five vegetables. Use
precision( ) function to set precision 2 for
NO

display price. 5
(c) What is function template ? Write a
function template to swap two given
IG

numbers. 10

BCS-031 2
5. (a) What is containership ? Write the
important containers available in C++ with

m
their importance. 10

.co
(b) What do you mean by exception handling ?
Write the syntax of try, throw and catch
expressions. Write a program to catch all

uru
the exceptions in C++ programs. 10

ntG
me
ign
ss
UA
NO
IG

BCS-031 3 6,500
No. of Printed Pages : 3 CI 1Es I BCS-031

m
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)

.co
Term-End Examination
December, 2015

uru
BCS-031 : PROGRAMMING IN C ++
Time : 3 hours Maximum Marks : 100

ntG (Weightage : 75%)

Note : Question no. 1 is compulsory and carries 40


marks. Attempt any three questions from the rest.
e
1. (a) What is structured programming ? Write
nm

the disadvantages of structured


programming. 5
(b) How do you input non-graphic characters
in the C++ programming language ? What
sig

do these escape sequences represent ? 5


(i) \n
(ii) a
As

(iii) \v
(c) Write a C++ program to demonstrate the
use of switch statement. 5
OU

(d) Write the appropriate statements to create


a function template printarray that can
display the values contained in array
IGN

passed as parameter to the function. The


function must be able to accept integer,
float and character arrays as arguments. 10

BCS-031 1 P.T.O.
(e) Describe the concept of classes and objects

m
through examples. 5
(f) What are Container Classes ? List the

.co
different types of containers and give three
examples of each.
(g) List any five common examples of
exceptions.

uru
2. (a) Consider an example of declaring the
examination result of BCA students of

ntG
IGNOU. Design three classes : Student,
Exam and Result. The Student class has
data members such as those representing
roll no., name, etc.
e
Create the class Exam by inheriting
nm

Student class. The Exam class adds fields


representing the marks scored in 6
subjects.
sig

Derive the Result from the Exam class, and


it has its own fields such as total marks.
As

Write an interactive program to model this


relationship by showing the three classes.
OU

Also, show how you can print out the


values of each member of these classes. 10+5=15
IGN

(b) Define member function. Explain the


purpose of member function. 5

BCS-031 2
3. (a) Define friend function. Discuss memory

m
requirements for classes, objects, data
members and member functions with an

.co
example. 10

(b) Write a C++ program to print Student

uru
details : Student Name, Father's Name,
Mother's Name, Student Address, Zip code,
Student Roll No. using constructor and
destructor. 10

4.
ntG
(a) Explain briefly the importance of pure
virtual function in the software
development paradigm. Write a C++
e
program with abstract class having pure
nm

virtual function. 10
(b) Explain exceptions in C++ program
through an example. 10
sig

5. (a) Explain Inheritance and Multi-Inheritance


with an example. Write a C++ program
which has Inheritance and
As

Multi-Inheritance. 10

(b) Define Operator Overloading. Write the


OU

general rules for Operator Overloading. 10


IGN

BCS-031 3 11,000
No. of Printed Pages : 3 BCS-031

m
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)

.co
Term-End Examination
June, 2016 .

7E;

uru
BCS-031 : PROGRAMMING IN C++

tG
Time : 3 hours Maximum Marks : 100
(Weightage : 75%)
en
Note : Question no. 1 is compulsory and carries 40 marks.
Attempt any three questions from the rest.
nm

1. (a) What is Software Re-usability ? Explain in


the context of C++ with an example. 5
sig

(b) Define visibility of a class member. Why


are different types of visibility modes
needed in derivation of a derived class ?
As

(c) Explain C++ streams and stream classes


with an example.
OU

(d) List the C++ operators that cannot be


overloaded. Give reasons for any two of
IGN

these explaining why they cannot be


overloaded. 5
BCS-031 1 P.T.O.
(e) Explain file pointers and operations. Write

m
a C++ program which demonstrates the use
of put( ) — get( ) and read( ) — write( ). 10

.co
(f) Differentiate between information hiding
and encapsulation. 5

(g) What do you mean by global variable and

uru
local variable in C++ ? Distinguish with an
example.

tG
2. (a) Write a C++ program to demonstrate break
and continue statement. 10
en
(b) Write a C++ program which explains
user-defined stream manipulators. 10
nm

3. (a) Distinguish between class templates and


function templates, through an example. 10

(b) Write an interactive C++ program which


sig

reads two integer numbers x and y, and an


operator. It then performs the following
operations :
As

(i) x+y
(ii) x — y
(iii) x * y
OU

(iv) x / y
If any other operator is entered, the
IGN

program prints out an error message. 10

BCS-031 2
4. (a) What are base and derived classes ? Create

m
a base class called Stack and a derived
class called Mystack. Write an interactive

.co
C++ program to show the operations of a
stack. 10

(b) Define Polymorphism. Explain various

uru
types of polymorphism with examples. 10

5. (a) Write a C++ program which explains the

tG
usage of Try, Throw and Catch.
(b) Write a C++ program for finding the
10
en
difference between two times that are
given in 24 hour format. So
nm

"19:00:00" — "3:30:00" = 15:30:00, while


"09:00:00" — "13:30:00" = "19:30:00". 10
sig
As
OU
IGN

BCS-031 5,500
No. of Printed Pages : 3 I BCS-0311

m
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)

.co
Term-End Examination
De December, 2016

uru
BCS-031 : PROGRAMMING IN C++

tG
Time : 3 hours Maximum Marks : 100
(Weightage : 75%)
en
Note : Question no. 1 is compulsory and carries 40 marks.
Attempt any three questions from the rest.
nm

1. (a) Explain the basic features of an


object-oriented language. Why did people
change over from structured programming
sig

to object-oriented programming ?

(b) Abstract class provides a base upon which


As

other classes may be built. Justify the


above statement with the help of an
example.
OU

(c) What do you mean by inheritance ? Explain


the advantages of using multiple
IGN

inheritance in C++ with the help of an


example. 7
BCS-031 1 P.T.O.
(d) Explain the importance of a constructor in

m
object-oriented programming. Differentiate
between copy constructor and default
constructor in C++ with the help of an

.co
example. 7
(e) What is function overloading ? Give its

uru
advantages in a C++ program. Also write a
C++ program to show function overloading.

(f) How does a virtual function differ from a

tG
pure virtual function ? Also give an
example of a pure virtual function. 6
en
2. (a) What is exception handling ? What is the
sequence of events when an exception
nm

occurs ? Write a C++ program that uses


exception handling to handle the errors
caused, when a number is divided by zero. 10
(b) Differentiate among private, public and
sig

protected access modifiers. Also explain


their meaning when a derived class
inherits from a base class using public,
As

protected or private keywords, with the


help of an example. 10
OU

3. (a) Write a program to add two complex


numbers by using binary operator
overloading. Write comments in the
IGN

program wherever it is required, to give


more clarity to the program. 10

BCS-031 2
(b) Write a program in C++ to calculate the
factorial of a given number. 5

m
(c) Explain the association of dynamic binding

.co
and run-time polymorphism, with example. 5

4. (a) How is unformatted I/O different from


formatted I/0 ? Explain.

uru
5

(b) Write a C++ program to create a Book


class. Define constructor and destructor for

tG
this class. Also define the methods to show
the title and price of the books.
en
(c) Explain the use of the following operators
in C++ :
(i) &
nm

?:
sig

(iv) &&

Write short notes on the following : 4 x5=20


As

(a) New and Delete Operator


(b) Parameterized Constructor
OU

(c) Class Template


(d) Pure Virtual Function
IGN

BCS-031 3 9,000
No. of Printed Pages : 3 I BCS-031(S) I

m
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)

.co
i u Term-End Examination
December, 2016

uru
BCS-031(S) : PROGRAMMING IN C++

Time : 3 hours
tGMaximum Marks : 100
(Weightage : 75%)
en
Note : Question number 1 is compulsory and carries
40 marks. Attempt any three questions from the
nm

rest.

1. (a) What is object oriented programming ?


Explain its advantages over structured
sig

programming. 6

(b) Write a C++ program to create a class


As

"Number" with a constructor to initialize


the object of "Number" class with one
integer value. Define member functions to
OU

find the square of a number and for


displaying it. 10

(c)What is a constructor ? Explain how


IGN

constructors are overloaded in C++, with


the help of an example. 6
BCS-031(S) 1 P.T.O.
(d) Explain any four different data types

m
available in C++. 8

(e) What is a stream manipulator ? Explain

.co
the use of setw( ) and setprecision( ) as a
stream manipulator. 5

(f) Write a C++ program to check whether a

uru
given number is an even number or an odd
number.

2. (a) Write a C++ program to overload `+'

numbers. tG
operator to find the sum of two complex ,
12
en
(b) What is the concept of reusability ? Explain
how a class is derived from a given class in
nm

C++, with the help of an example. 8


3. (a) What is an abstract class ? Explain its
advantages. How is polymorphism
implemented using an abstract class ? Give
sig

an example. 10

(b) What is an exception ? How is it handled M.


As

C++ ? Write a program demonstrating


exception handling in C++. 10
OU

4. (a) What is function overloading ? Explain how


it is implemented in C++. 10
(b) What is a template class ? Explain its
IGN

advantages. Create a template class for a


LinkedList data structure. 10

BCS-031(S ) 2 P.T.O.
5. (a) What is an access specifier ? Explain

m
different types of access specifiers available
in C++. 5

.co
(b) What is dynamic binding ? Explain with
the help of an example. 5
(c) Write a C++ program to define a class

uru
"Account". Derive a "Saving_Account"
class from the Account class. Define
appropriate constructors for both the
classes. Also define a method to display the

tG
account balance. Make necessary
assumptions, if required. 10
en
nm
sig
As
OU
IGN

BCS-031(S) 3 500
No. of Printed Pages : 3 I BC S-031 I
BACHELOR OF COMPUTER APPLICATIONS

m
(BCA) (Revised)
Term-End Examination

.co
June, 2017

BCS-031 : PROGRAMMING IN C++

uru
Time : 3 hours Maximum Marks : 100

tG
(Weightctge : 75%)

Note : Question no. 1 is compulsory and carries 40 marks.


en
Attempt any three questions from the rest.
nm

1. (a) Why are object oriented programming


languages more popular than structured
programming languages ? Differentiate
sig

between structured and object oriented


programming languages.
(b) Explain ambiguity resolution in multiple
As

inheritance. What happens if we don't use


a virtual function in the inheritance ?
(c) Write a C++ program to create a matrix
OU

class. Define constructor and destructor for


this class. Also define a method to find the
sum of two matrices. 10
IGN

BCS 031
- 1 P.T.O.
(d) Define the Standard Template Library.
How is the class template different from

m
the function template ? Explain. 6

.co
(e) Differentiate between private, protected
and public access modifiers with the help of
an example for each. 6

uru
(f) How is constructor different from the
`constructor with argument' ? Explain by
using an example. 6

2. tG
(a) Write a program to demonstrate the
en
catching of all exceptions. What happens
when a raised exception is not caught by
nm

catch-block (in the absence of catching all


exception blocks) ? 10

(b) Write a program to implement the


sig

overloading of « operator. 10

3. (a) How do we declare static class data ?


As

Explain the syntax and rules to define


static class data. 5
OU

(b) Write a short program to implement the


concept of passing object as argument. 5
IGN

BCS-031 2
(c) Write the general form of the user-defined
manipulators. Design a single manipulator

m
format to provide the following output
specifications for printing float values : 10

.co
(i) 10 column width
(ii) Right Justified
(iii) Two-digit precision

uru
(iv) Filling of unused places with *
(v) Trailing zeroes shown

4.
tG
(a) What is the importance of Abstract Class ?
Write a program to implement the concept
en
of abstract class in C++. Also explain why
an abstract class cannot be instantiated. 10
(b) Write a program to calculate the factorial
nm

of a given number by using copy


constructor. Also write comments in your
program wherever required. 10
sig

5. Write short notes on the following : 4 x 5=20


(a) Destructor
As

(b) Pure Virtual Function


(c) Friend Function
OU

(d) Multiple Inheritance


IGN

BCS-031 3 3,500
No. of Printed Pages : 4 I BCS 031
-

BACHELOR OF COMPUTER APPLICATIONS

m
(BCA) (Revised)
Term-End Examination

.co
1:316-7 44 O December, 2017

uru
BCS-031 : PROGRAMMING IN C++

Time : 3 hours Maximum Marks : 100

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

What do you mean by Abstraction and


nm

1. (a)
Encapsulation ? How are the two terms
interrelated ? 4
(b) What is a Reference Variable ? What is its
sig

usage ?
(c) Identify the errors in the following code
As

segment : 4
int main( )
OU

cout « "Enter two numbers";


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

BCS-031 1 P.T.O.
(d) Why will the function given in the
following code fragment not work ? What

m
should be done to make it work ?
int main( )

.co
float sum (float, float);

uru
void calc(void)

tG
en
float x, y, s;

cin » x » y
nm

s = sum (x, y);


sig

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


significance of friend functions ? 4
As

(f) What do you mean by Static Data Members


of a class ? Explain the characteristics of
static data members.
OU

4
(g) What do you understand by a Default
Constructor ? How is a default constructor
IGN

equivalent to a constructor with default


arguments ? 4
BCS-031 2
(h) What is Function Overloading ? Compare
default arguments with function

m
overloading.
(i) When should one derive a class publicly or

.co
privately ? Give a suitable example in
support of your answer.
(j) What are Iterators ? List the five types of

uru
iterators supported by STL in C++. 4

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


differ when
tG
(i) an object is passed by value ?
en
(ii) an object is passed by reference ? 7
(b) What is Operator Overloading ? List the
nm

operators which cannot be overloaded. Give


reasons behind it. 7
(c) What is 'this' Pointer ? Explain the
sig

significance of 'this' pointer with the help of


an example. 6
As

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
OU

illustrate the difference. 10


(b) What is Message Passing ? Explain how
IGN

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

m
the usage of these concepts with suitable
10

.co
example code in C++.
(b) What is an Exception in C++ ? Explain how
exception handling is done in C++ with the

uru
help of a program. What will happen if
exception is thrown outside of a try block ?
Give reasons for such a happening. 10

5. tG
(a) Write a program in C++ to create a class
en
Employee with basic data members such as
name, address, age. Create a class
Part_time employee which inherits from
nm

the Employee class. Part_time class should


have a function to display the name,
address and payment of the part-time
sig

employee. 10

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


As

environment of a simple calculator. 10


OU
IGN

BCS-031 4 15,000
No. of Printed Pages : 4 BCS-031(S)

m
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)

.co
0 02 5 4 Term-End Examination
December, 2017
BCS 031(S) : PROGRAMMING IN C++

uru
-

Time : 3 hours Maximum Marks : 100


(Weightage : 75%)

ntG
Note : Question number 1 is compulsory and carries
40 marks. Attempt any three questions from the
rest.
me

1. (a) What is the difference between a keyword


and an identifier ? Write a simple program
in C++ to show these two concepts. 4
n

(b) What are data modifiers ? How do they


sig

affect the base data type ? Give suitable


example. 4

(c) Given the following code fragment :


As

int ch = 20;
cout « ++ch « "\ n"
OU

« ch « "\n";
(i) What output does the above code
fragment produce ?
IGN

(ii) What is the effect of replacing ++ch


with ch + 1 ? 4

BCS-031(S) 1 P.T.O.
(d) Identify the problem with the following

m
code. Suggest the way to correct the
problem. 4
void large (int &a, int &b);

.co
int main( )
{ large (5, 7); }

uru
void large (int &a, int &b)
{ if (a > b)
a = —1;
else
b = —1; } ntG
(e) What are inline functions ? Give the
advantages and disadvantages of an inline
me
function. 4
(0 How is the working of a member function
different from a friend function and a
n

non-member function ? 4
sig

(g) What is a Copy Constructor ? Discuss the


situations when a copy constructor is
automatically invoked. 4
As

(h) Explain any four benefits of object oriented


programming. 4
OU

(i) What is an Object ? Explain with an


example, how an object is instantiated. 4
(j) Can a derived class get access privilege for
IGN

a private member of the base class ? If yes,


how ?

BCS-031(S) 2 P.T.O.
2. (a) What is Abstract Class ? Explain the use of
abstract class in C++, with the help of an

m
example program. 10

.co
(b) What is an Exception ? Explain briefly
about the exception handling process while
executing constructors and destructors.

uru
Also explain with an example, how
exception types are specified in a C++
program. 10

3.
following : 5 tG
(a) Differentiate between any two of the
en
(i) ios : : ate and ios : : app
(ii) Binary file and Text file
nm

(iii) get( ) and getline( )

(b) What is a Pure Virtual Function ? Explain


the characteristics of a pure virtual
function with the help of an example. 8
sig

(c) What is a stream in C++ ? Name the


streams generally used for file 1/0. Give
their utility in a C++ program.
As

4. (a) What is a Template Class ? Give the


advantages of a template class. Create a
OU

template class for linked-list data


structure. 10
(b) How are function calls matched with
IGN

overloaded functions in C++ ? Explain with


the help of a program in C++. 10
BCS-031(S) 3 P.T.O.
5. (a) Write a program in C++ to open an existing

m
file and insert the text "File program in
C++" at the end of it. Your program should
have suitable comments for each line of

.co
code. 10

(b) Write a program in C++ to multiply two

uru
complex numbers. In this program you
need to create a complex class and define a
proper constructor for object initialization. 10

tG
en
nm
sig
As
OU
IGN

BCS-031(S) 4 500
No. of Printed Pages : 3 B CS 031
- I

m
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)

.co
05405 Term-End Examination

uru
June, 2018

BCS-031 : PROGRAMMING IN C++

Time : 3 hours
ntG Maximum Marks : 100
(Weightage : 75%)
Note : Question no. 1 is compulsory and carries 40 marks.
me

Attempt any three questions from the rest.


gn

1. (a) Define Abstraction and Encapsulation in


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

(b) What is polymorphism ? Explain its


As

advantages. Write a C++ program to


demonstrate polymorphism. 10
OU

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


two given numbers. 4

(d) What is a constructor ? Explain the


IGN

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

m
program in C++ to define a class "Teacher's
with a virtual function "Salary". Derive

.co
class "Associate-Professor" from class
teacher and implement the salary function. 10

uru
(f) What is encapsulation ? Are encapsulation
and information hiding the same ? Explain. 5

2. (a) Explain the different types of operators


available in C++. ntG 10

(b) What is inheritance ? What are the


different types of inheritance supported
me

by C++ ? Explain how inheritance is


implemented in C++. 10
gn

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


"Circle" and implement the following : 10
si

(i) a constructor
As

(ii) a member function to find area of a


circle
OU

(iii) a member function to find


circumference of a circle

(b) How is function overloading implemented


IGN

in C++ ? Explain with an example


program. 10
BCS-031 2
4. (a) What is a friend function ? Explain how it

m
is implemented iii C++, with the help of an
example program. 10

.co
(b) What is a template class ? Create a
template class for stack data structure. 10

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

List Container class with the help of an

(b)
example.
ntG
What is an exception ? How is it handled in
6

C++ ? Explain it with the help of an


me
example. 6

(c) Explain the following with the help of an


example : 2x4=8
gn

(i) Destructor
(ii) Inline function
si
As
OU
IGN

BCS-031 3 6,000
No. of Printed Pages : 2 BCS-031(S)

m
BACHELOR OF COMPUTER APPLICATIONS

.co
(BCA) (Revised)
Term-End Examination
December, 2018

uru
BCS-031(S) : PROGRAMMING IN C++

Time : 3 hours ntGMaximum Marks : 100


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

1. (a) Write four advantages and four


disadvantages of structured programming. 8
sig

(b) Differentiate between information hiding


and encapsulation with an example. 4
(c) What are the operators in C++ ? Explain
As

with an example. 8
(d) Write a program in C++ to demonstrate the
OU

use of Switch statement. 6


(e) Explain class templates and function
templates with illustrations. 10
IGN

(f) What are the benefits of inheritance ?


Explain in brief. 4
BCS-031(S) 1 P.T.O.
2. (a) What is inline function ? Explain its

m
advantage with an example. 6
(b) Write a C++ program to find out the sum of

.co
n numbers, by defining proper class,
constructor and methods. 10

uru
(c) Explain the use of nested if statement
with the help of an example. 4

3. (a) Define Member function and Friend

(b)
ntG
function. Write the purpose of each.
Write a C++ program to demonstrate how
8

objects are passed as an argument. 7


e
(c) Write a program in C++ to find the
nm

factorial of a given number. 5

4. (a) What do you mean by constructor


overloading in C++ ? Explain with the help
sig

of an example. 10
(b) What is copy constructor ? Illustrate the
use of copy constructor with help of a
As

program in C++. 10

5. Write brief notes on the following : 4x5=20


OU

(a) Message Passing


(b) Polymorphism
IGN

(c) Type Conversion


(d) File Pointers and Operations

BCS-031(S) 2 8,000
1169002

m
No. of Printed Pages : 4 BCS-031

.co
Bachelor of Computer Applications
(BCA) (Revised)
Term-End Examination

uru
June, 2019
BCS-031 : PROGRAMMING IN C++

Time : 3 Hours
ntG Maximum Marks : 100

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

1. (a) What is object oriented programming


paradigm ? Explain advantages of object
ss

oriented programming paradigm over


structured programming paradigm. 5
UA

(b) What is the need of memory management


in C++ ? Explain the process of memory
management in C++. 5
NO

(c) What is a virtual function ? How does


virtual function differ from function in
C++ ? Explain with example. 5
IG

(A..27) P. T. 0.
[2] BCS-031

(d) What is operator overloading ? Briefly

m
explain general rules of operator
overloading.

.co
5
(e) What is stream manipulator ? Explain the
use of setw( ) and setprecision( ) as stream

uru
manipulator. 5
(f) What is an object in C++ ? Explain, how an
object can be passed as an argument to a

ntG
function, with the help of an example.
(g) What is scope resolution operator ? Explain
the use of scope resolution operator with
5
me
the help of a C++ program. 5
(h) Explain any five relational operators in
C++ with the help of examples. 5
ign

2. (a) What do you understand by friend function ?


Write a C++ program, to find out the sum
ss

of n given numbers using friend function. 7


(b) Explain the' difference between public,
UA

private and protected, access specifiers


with respect to classes in C++. 6
NO

(c) Differentiate between default constructor


and parameterized constructor with the
help of an example program in C++. 7
IG

(A-27)
I3/ BCS-031

m
3. (a) What do you mean by operator-overloading
in C++ ? List the operators which cannot

.co
be overloaded. Write a program in C++, to
overload unary minus (—) operator. 10
(b) What is exception handling ? What are the

uru
keywords, used to handle the exception in
C++ ? Write a C++ program to handle
divide by zero exception. 6

ntG
(c) How is structure different from a class ?
Explain with example. 4
me
4. (a) What is static member ? Explain the use of
static data member and static member
function, with the help of an example
ign

program in C++. 7
(b) Explain the use of the following standard
stream objects with the help of examples :
ss

8
(i) cin
UA

cout
cerr
NO

(iv) clog
(c) What is function template ? Explain this
IG

concept, with the help of an example. 5


(A-27) P. T. 0.
14] BCS-031

m
5. Write short notes on the following (give
example code in C++ for each) : 5 each

.co
(a) Overriding concept in C++

(b) Message passing

uru
(c) Encapsulation

(d) Object initialization and its need

ntG
me
ign
ss
UA
NO

BCS--031 • 5,500
IG

(A-27)
M06874

m
No. of Printed Pages : 2
I BCS-031 I

co
BACHELOR OF COMPUTER APPLICATIONS
(BCA) (Revised)

.
uru
Term-End Examination,
December 2019
BCS-031 : PROGRAMMING IN C++
Time : 3 Hours]
ntG [Maximum Marks : 100
(Weightage : 75%)
Note : (i) Question No. 1 is compulsory and carries 40 marks.
me
(ii) Attempt any three questions from the rest.

1. a) Explain the use of 'Break' and 'Continue' statement


in C++, with example program. 5
ign

b) What are Access control specifiers? Explain various


types of access control specifiers. 5
c) What is 'Copy constructor'? Explain it with the help
of a suitable C++ program. 5
ss

d) Explain the concept of Friend function with suitable


example code in C++. 5
UA

e) Compare while ( ) and do-while( ) looping


constructs with the help of suitable example for
each. 5
NO

f) Write a program in C++, to find the largest of given


three numbers by using a member function defined
in a class. 5
g) What is Object initialization? Why it is required,
IG

explain with the help of an example. 5


h) Explain the usage of single inheritance and multiple
inheritance. 5
m
(2)

2. a) What is a Class template? How it is different from

co
function template? Give example for each. 8
b) What are Inline functions? Discuss their importance
in programming. Write an example program in C++

.
to clarify the concept of Inline functions. 8

uru
c) What is Polymorphism? Give three advantages of
polymorphism. 4

ntG
3. a) Discuss the role of virtual functions in inheritance.
What happens if we don't use virtual functions in
inheritance? Give suitable example in support of
your discussion. 10
b) What are File stream operations? Write a program
me
in C++ to demonstrate the file reading and writing
operations. 10

4. a) Explain the concept of parameter passing using call


ign

by value and call by reference with suitable


examples. 8
b) Compare Run time polymorphism and Compile
ss

time polymorphism. Give suitable example of each.


8
c) What is destructor? Explain its use in C++ with the
UA

help of an example. 4

5. Write short notes on the following: 4x5=20


NO

a) Code Reusability
b) 'this' pointer
c) Containers and its types in C++
IG

d) Stream manipulators

4 44.000.
m
BCS-031

.co
No. of Printed Pages : 4

BACHELOR OR COMPUTER

uru
APPLIATIONS (BCA) (REVISED)

Term-End Examination

tG
June, 2020
en
BCS-031 : PROGRAMMING IN C++
nm

Time : 3 Hours Maximum Marks : 100


sig

Weightage : 75%

Note : Question No. 1 is compulsory and carries


As

40 marks. Attempt any three questions from

the rest.
OU

1. (a) Explain, how structured programming


IGN

. paradigm is different from object oriented

paradigm. 5

P. T. O.
m
[2I BCS-031

(b) What is encapsulation ? How is it different

.co
from information hiding ? Explain with the

help of an example. 5

uru
(c) Explain the concept of copy constructor

with the help of an example and program.5

tG
(d) What is access control specifier ? Explain
en
public access control specifier with
nm

example. 4

(e) Explain, how memory management is


performed in C++. 5
sig

(f) What is a stream manipulator ? Explain


the use of setw( ) and setprecision( ) as
As

stream manipulator. 6
OU

(g) What is operator overloading ? Briefly


discuss the general rules of operator
overloading. 6
IGN

(h) What is scope resolution operator ? Explain


its use with the help of a C++ program. 4
m
I3 BCS-031

2. (a) What is a container in C++ ? List main

.co
types of container in C++. Also list some

common member functions of Container

uru
class. 10

(b) What is static member in C++ ? Explain

tG
the use of static data member and static

member function with the help of an


en
example and program in C++. 10
nm

3. (a) What do you mean by polymorphism ? How

is runtime polymorphism different from

compile time polymorphism ? Give


sig

example(s) to support the above difference.


As

10

(b) What is a virtual function ? How virtual


OU

function relates to inheritance ? What

happens if we don't use the virtual function


IGN

in the inheritance ? Explain with the help

of an example and program. 10

P. T. O.
m
[4] BCS-031

4. (a) What is message passing ? Demonstrate

.co
the utility of message passing with the

help of an example code in C++. 8

uru
(b) Write a program in C++ to add two 3 x. 3

matrices. Define proper class, constructor,

tG
destructor and methods in the program. 12
en
5. (a) Write a program in C++ to open an existing

file and insert the text "My C++ file" at the


nm

end of it. Incorporate suitable comments, to

improve the code readability. 10


sig

(b) What is a friend function ? Explain two

merits and two demerits of using friend


As

functions, with the help of an example. 10


OU
IGN

BCS-031 3,030
No. of Printed Pages : 4 BCS-031

om
BACHELOR OF COMPUTER
APPLICATIONS (B. C. A.) (REVISED)

u.c
Term-End Examination
December, 2020

ur
BCS-031 : PROGRAMMING IN C++

Time : 3 Hours
tG Maximum Marks : 100
en
Weightage : 75%
Note : Question number 1 is compulsory and
m

carries 40 marks. Attempt any three


questions from the rest.
ign

1. (a) What is construction ? Explain the


ss

advantages of construction with the help of


an example. 5
UA

(b) What is function template ? Write a


function template SUM to add two
NO

numbers. 5

(c) List the merits and demerits of single


IG

inheritance over multiple inheritance. 5

Lot-I P. T. O.
[2] BCS-031

(d) How is a structure in C++ different from

om
a class ? Explain with the help of
example. 5

(e) What is an object in C++ ? Explain, how an

u.c
object can be passed as an argument to a
function with the help of an example. 5

ur
(f) What is friend function ? Explain its

tG
advantages with the help of an example. 7

(g) What is an inline function ? Explain the


en
advantages of inline function, with suitable
example. 8
m

2. (a) What is exception ? Explain, how exception


ign

handling is done in C++, with the help of a


program. Also discuss, what will happen if
ss

an exception is thrown outside of a try


block. 10
UA

(b) What is template class ? Explain the


advantages of template class. 5
NO

(c) Write a C++ program to find the average


three given numbers. Define appropriate
IG

class and methods in the program. 5


[3] BCS-031

3. (a) What is function overloading ? How is it

om
different from function overriding ?

Explain with an example program for

u.c
each. 10

(b) What is virtual function ? Write a program

ur
in C++ to create a class Doctor with a

tG
virtual function salary. Derive a class

visiting Doctor and implement function


en
salary in it. 10
m

4. (a) Explain, how function calls are matched in


ign

a C++ program in which functions are

overloaded. Use appropriate example


ss

program for your explanation. 10

(b) Write a C++ program to implement simple


UA

calculator to perform ‘+’, ‘–’, ‘*’, ‘/’ on two


NO

operands. Your program should have

methods for reading data and for


IG

performing arithmetic operations. 10

P. T. O.
[4] BCS-031

5. Write short notes on the following : 5×4=20

om
(i) Copy constructor

(ii) Access control specifier

u.c
(iii) Stream manipulators

(iv) Message passing

ur
(v) Scope resolution operator

tG
en
m
ign
ss
UA
NO
IG

BCS–031
No. of Printed Pages : 4 BCS-031

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

.c
June, 2021

ru
BCS-031 : PROGRAMMING IN C++

u
Time : 3 hours Maximum Marks : 100

tG
(Weightage : 75%)

Note : Question no. 1 is compulsory and carries 40 marks.


en
Attempt any three questions from the rest.

1. (a) Compare Structured programming with


m
Object-oriented programming. Give two
advantages of both. 5
ign

(b) What are Inline Functions ? How does the


execution of inline functions differ from
ss

normal functions ? Give the advantages of


inline functions. 5
UA

(c) Explain passing of objects as argument to a


function with the help of an example. 5
(d) What is a Friend Function ? Briefly discuss
NO

the properties of a friend function. 5


(e) How does Constructor differ from
Automatic Initialization ? Briefly discuss
IG

the term Copy Constructor. 5

BCS-031 1 P.T.O.
(f) What is Function Overloading ? How are
function calls matched with overloaded

om
functions ? Explain with the help of an
example. 5

.c
(g) Compare Early Binding and Late Binding.
Explain when to use which type of

ru
binding. 5

u
(h) What are Exceptions in C++ ? How is
exception handling done in C++ ? Briefly

tG
discuss the functioning of Try, Throw and
Catch expressions with suitable block
en
diagram. 5
m
2. (a) Briefly discuss the term Message Passing.
How does message passing support the
ign

concept of interfaces in C++ ? 5

(b) Differentiate between C and C++, give at


ss

least five differences. 5

(c) What is Type Conversion ? What is the


UA

advantage of Type Conversion ? Briefly


discuss Type Casting and Automatic Type
Conversion. 5
NO

(d) Compare Break and Continue statement.


Exhibit the usage of break and continue
IG

statement with suitable code in C++. 5

BCS-031 2
3. (a) What is a Static Member Function ? Write
a program in C++ to illustrate the concept

om
of the static member function. 5

(b) What is a Destructor in C++ ? Discuss the

.c
naming conventions of destructor. Do
constructors and destructors have return

ru
type ? 5

(c) What is Access Specifier ? Explain different

u
access specifiers in C++. 5

tG
(d) Explain the use of ‘&&’ and ‘!’ operators in
C++ with the help of an example. 5
en
4. (a) What is Inheritance ? What are the
m
advantages of inheritance ? Explain with
the help of example. 5
ign

(b) Compare Multi-level and Multiple


inheritance in C++ with the help of an
example. 5
ss

(c) What are the limitations of Operator


overloading and Function overloading. 5
UA

(d) Compare Compile-time Polymorphism with


Run-time Polymorphism. 5
NO

5. (a) What are Stream Manipulators ? Briefly


discuss the purpose of various stream
IG

manipulators. 5

BCS-031 3 P.T.O.
(b) Compare Class templates and Function

om
templates with the help of example code. 5

(c) Write short notes on the following : 10

(i) Default and Parameterized

.c
Constructor

ru
(ii) Virtual Functions and their
limitations

u
tG
en
m
ign
ss
UA
NO
IG

BCS-031 4
[2] BCS-031

(b) What do you understand by scope of a


No. of Printed Pages : 5 BCS-031
variable ? Compare global variable and
BACHELOR OF COMPUTER
local variable in C++. 5
APPLICATIONS (BCA) (REVISED)

o m
(c) Compare structures and classes in C++.
Term-End Examination
.c
What are empty classes ? Explain the

u
December, 2021
u r
purpose of empty classes. 5

BCS-031 : PROGRAMMING IN C++

nt G
(d) What are static members of a class ? What

Time : 3 Hours Maximum Marks : 100


e is the utility of having static members ?

Weightage : 75%

n m Explain with the help of an example. 5

Note : Question number 1 is compulsory and carries

s i g (e) What are constructors ? Write the

A s
40 marks. Attempt any three questions from characteristics of a constructor. What are

the rest.

O U the limitations of a constructor ? 5

G N
1. (a) What are the essential properties of object (f) What is operator overloading ? Why some

oriented
I
oriented programming ? How does object

programming differ from


operators can’t be overloaded ? Write a

program to overload ‘+’ operator to add two

structured programming ? 5 complex numbers. 10

P. T. O.
[3] BCS-031 [4] BCS-031

(g) What is STL ? Briefly discuss the 3. (a) What is a friend function ? Write a

components of STL. 5 program in C++ to illustrate the concept of

friend function. 5
2. (a) What do you understand by the signature of

a method ? Briefly discuss the components of


o m
(b) Explain copy constructor with the help of

.c
an example program. 5

u
the signature of a method. 5

(b) Compare virtual functions and pure virtual


u r
(c) Discuss the role of “new” and “delete” as

functions with the help of an example. 5

nt G memory management operations. 5

e
(d) Explain the role of destructors in C++
(c) Discuss the taxonomy of C++ data types

m
memory management. Write a program

n
with the help of a suitable block diagram. 5

g
in C++ to demonstrate the use of
(d) What are Breaking Statements ? Give

s i destructors. 5
syntax of the following
s
breaking

A 4. (a) Explain the access specifiers used in


statements :

O U 5
inheritance in C++ with the help of an

N
(i) break
example. 5
(ii) continue

(iii) goto
I G (b) Compare multiple inheritance with

multilevel inheritance and hierarchical

(iv) exit inheritance. 5

P. T. O.
[5] BCS-031

(c) What is Polymorphism ? What are the

advantages of polymorphism ? Mention the

types of polymorphism supported by C++. 5

(d) Briefly discuss the term function

o m
.c
overriding, with the help of suitable

example code in C++. 5

r u
5. Write short notes on the following : 5×4=20

Gu
(a) File Stream Operations

nt
(b) Inline Functions
e
(c) Exception Handling

n m
(d) Class Templates

(e) Function Templates


s i g
A s
O U
G N
I
BCS–031

P. T. O.
No. of Printed Pages : 3 BCS-031

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

.c
June, 2022

ru
BCS-031 : PROGRAMMING IN C++

u
Time : 3 hours Maximum Marks : 100

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

1. (a) What is an access specifier ? Explain


m
different types of access specifiers available
in C++. 5
ign

(b) What is message passing ? Explain with


the help of an example. 5
(c) What is stream manipulator ? Explain the
ss

use of setw( ) and setprecision( ) as a


stream manipulator. 5
UA

(d) What is a constructor ? Explain how


constructor is overloaded in C++, with the
help of an example. 5
NO

(e) What is object oriented programming ?


Give two advantages of object oriented
programming over structured
IG

programming. 5

BCS-031 1 P.T.O.
(f) How does virtual function differ from a

om
pure virtual function ? Explain with the
help of an example. 5

(g) Explain the association of dynamic binding

.c
and runtime polymorphism, with suitable
example. 5

ru
(h) Explain the concept of Inline function in

u
C++, with suitable example. 5

tG
2. (a) Write a program in C++ to define a class
en
‘‘Teacher’’ with a virtual function ‘‘Salary’’.
Derive the class ‘‘Assistant Professor’’ from
the class ‘‘Teacher’’ and implement the
m

salary function. Make necessary


ign

assumptions. 10

(b) What is class template ? Create a class


template for stack data structure. 10
ss

3. (a) What is the difference between function


UA

overloading and function overriding in


C++ ? Explain the usage of these concepts,
NO

with suitable example in C++. 10

(b) What is inheritance ? Explain different


types of inheritance in C++. 10
IG

BCS-031 2
4. (a) Write a program in C++ to open an existing
file and insert the text ‘‘File program in

om
C++’’ at the end of the file. Your program
should have suitable comments. 10

.c
(b) Write a program in C++ to multiply two
complex numbers. In this program you

ru
need to create a complex class and define a
proper constructor for object initialization.

u
Give suitable comments in your program. 10

tG
5. (a) Differentiate between the following :
en 5
(i) Binary file and Text file
(ii) get( ) and getline( )
m
(b) What is stream in C++ ? Name the streams
generally used for file I/O. 4
ign

(c) What is the difference between a keyword


and an identifier ? Explain with the help of
ss

an example. 4

(d) What is the purpose of exception


UA

handling ? Explain how exception is


handled in C++, with the help of an
NO

example. 7
IG

BCS-031 3 P.T.O.
No. of Printed Pages : 4 BCS-031

om
BACHELOR OF COMPUTER
APPLICATIONS (BCA) (REVISED)

u.c
Term-End Examination

ur
December, 2022
BCS-031 : PROGRAMMING IN C++

Time : 3 Hours
tGMaximum Marks : 100
en
Weightage : 75%
m

Note : Question number 1 is compulsory and carries


ign

40 marks. Attempt any three questions from

the rest.
ss

1. (a) What is Encapsulation ? Are encapsulation


UA

and information hiding the same ? Explain.

5
NO

(b) What is an Exception ? How is it handled


in C++ ? Explain with the help of an
IG

example. 5

P. T. O.
[2] BCS-031

(c) What are containers ? Explain the use of

om
list container class with the help of an
example. 5

(d) Differentiate between copy constructor and

u.c
default constructor in C++, with the help of
an example for each. 5

ur
(e) “Abstract class provides a base, upon
which other classes may be built.” Justify
the statement,
tG with the help of an
en
example. 5

(f) What is a member function ? Briefly


m

discuss the purpose of member function in


C++, with suitable example. 5
ign

(g) What is ‘this’ pointer ? Explain the


significance of ‘this’ pointer with the help
ss

of an example program. 5
UA

(h) What are static data members of a class ?


Explain the characteristics of static data
members. 5
NO

2. (a) What is function overloading ? Explain


how it is implemented in C++ with the help
IG

of a program. 10
[3] BCS-031

(b) What is a class template ? Give two

om
advantages of class template. Create a
class template for a linked list data
structure. 10

u.c
3. (a) What is operator overloading ? Write a C++
program to overload ‘+’ operator to find the

ur
sum of two complex numbers. Support your

tG
program with suitable comments. 10

(b) What is a friend function ? How does it


en
differ from the member function ? Explain
the implementation of friend function in
m

C++, with the help of an example program.


ign

10

4. (a) What is inheritance ? Briefly discuss the


ss

different types of inheritance, supported by


C++. Explain how inheritance is
UA

implemented in C++. 10

(b) What is the difference between call by


NO

value and call by reference in a user


defined function in C++ ? Give an example
IG

to illustrate the difference. 10

P. T. O.
[4] BCS-031

5. Write short notes on the following with example

om
for each : 4 each

(i) Pure virtual functions

u.c
(ii) Message passing

(iii) Inline function

ur
(iv) Destructors and their need

tG
(v) Relational operators in C++
en
m
ign
ss
UA
NO
IG

BCS–031
No. of Printed Pages : 4 BCS-031

o m
BACHELOR OF COMPUTER

u.c
APPLICATIONS (BCA) (REVISED)

Term-End Examination

ur
June, 2023

tG
en
BCS-031 : PROGRAMMING IN C++

Time : 3 Hours Maximum Marks : 100


m
ign

Note : Question No. 1 is compulsory and carries

40 marks. Attempt any three questions from


ss

the rest.
UA

1. (a) What are virtual functions and what are


its uses ? Explain with example. 5
NO

(b) How is protected access specifier different


from public access specifier ? Explain its
IG

usage for a subclass. 5

P. T. O.
[2] BCS-031

(c) Explain two unique features of object

m
oriented programming over structured
programming with example. 5

o
(d) What is the utility of friend function ? Does

u.c
it violate the rule of encapsulation ? 5

(e) Differentiate between early binding and

ur
late binding with an example of each. 5

tG
(f) What are constructors in C++ ? Mention
their five characteristics. 5
en
(g) What is Runtime Polymorphism ? Explain
its utility with the help of an example. 5
m

(h) What is STL ? Explain the importance of


ign

STL library in C++. 5

2. (a) What is object oriented programming ?


ss

Explain the benefits of object oriented


programming. 5
UA

(b) Differentiate between automatic and type-


casting with the help of an example. 5
NO

(c) Explain the difference between information


hiding and encapsulation with the help of
IG

an example. 5
[3] BCS-031

(d) Explain the difference between method

m
overloading and method overriding with
example. 5

o
u.c
3. (a) What is inheritance ? Explain, how
inheritance is implemented in C++. 5

ur
(b) How do inline functions provide efficiency
during runtime ? Explain. 5

(c) What is the


tG
difference between If
en
statement and For loop ? Explain with
example. 5
m

(d) What is operator precedence ? Explain the


ign

order of operator precedence in


arithmetical operators in C++ with the
ss

help of an example. 5
UA

4. (a) Define the term class. How are class and


object related ? Explain with example. 5
NO

(b) How is static keyword used in C++ ?


Explain how the static keyword makes a
IG

difference when attached to a function. 5

P. T. O.
[4] BCS-031

(c) Differentiate between member functions

m
and global functions with help of an
example. 5

o
(d) How is memory allocation done in C++

u.c
when a class is declared and a class is
instantiated ? Explain with the help of an

ur
example. 5

tG
5. (a) What is the role of copy constructor ?
Illustrate the cases when it is invoked. 5
en
(b) What are private constructors and
m
destructors ? How are they different from
constructors and destructors which are not
ign

private ? Explain. 5

(c) What is the role of new operator in C++ ?


ss

Explain. Also explain delete operator. 5


UA

(d) What are stream manipulators ? Briefly


explain any two stream manipulators
in C++. 5
NO
IG

BCS–031

You might also like