SPRING-2018
Get solved
assignments at nominal price.
Mail us at: subjects4u@gmail.com or contact at
08894344452, 8219081362
BACHELOR OF COMPUTER APPLICATIONS (BCA)
SEMESTER - II
SUBJECT CODE & NAME
BCA213 - Object
Oriented Programming C++
Q1. Differentiate between an external variable
and an automatic variable with the help of an example. 10
Answer. Automatic variables is default variable in C++. All the
variables we have created and used in programs are automatic variables. These
variables can also be declared by prefixing the keyword auto. One of important
characteristics of
Q2. What is “this pointer” in C++? What are
the features of “this pointer”? [3+7]
Answer. The pointer is used as a pointer to the class
object instance by the member function. The address of the class instance is
passed as an implicit parameter to the member functions. The sample below, in
this section shows how to use it. It is common knowledge that C++ keeps only
one copy of each member function
Q3. Explain destructor in detail. 10
Answer.
Destructors are usually used to
deallocate memory and do other cleanup for a class object and its class members
when the object is destroyed. A destructor is called for a class object when
that object passes out of scope or is
Set - 2
Q1. What is Polymorphism? What are the
different types of Polymorphism? 3+7
Answer. Polymorphism means same content but different
forms. In C++, polymorphism enables the same program code calling different
functions of different classes. Imagine a situation where you would like to
create a class shape and derive classes such as rectangle, circle, triangle
etc. Let us suppose each of the classes has a member function draw() that
causes the object to be drawn on the screen. You would like to write a common
code as
Q2. Explain sequence containers. 10
Answer. STL provides a number of container types,
representing objects that contain other objects. The STL contains sequence
containers and associative containers. The standard sequence containers include
vector, deque and list
Q3. Discuss the following functions of file
operations
a) tellg ()
b) seekp ()
c) ignore ()
d) getline () 2.5x4
Answer. a) tellg()
tellg() – Returns an int type, that
shows the current position of the inside-pointer. This one works only when you
read a file. Example:
#include <
SPRING-2018
Get solved
assignments at nominal price.
Mail us at: subjects4u@gmail.com or contact at
08894344452, 8219081362
No comments:
Post a Comment