Get fully solved assignment. Buy
online from website
online store
or
plz drop a mail with your sub
code
we will revert you within 2-3
hour or immediate
Charges rs
125/subject
DRIVE
SPRING 2017
PROGRAM
Bachelor of Science in Information Technology
SEMESTER
II
SUBJECT
CODE & NAME BIT201 – Object Oriented Programming – C++
Assignment
Set -1
1 Differentiate between an
external variable and an automatic variable with the help of an example.
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
these variables are that they are created only when the function or program
block in which they are declared are called. Once the execution of function or
module execution is over, the variables are destroyed and the values are lost.
The reason for limiting the lifetime of
2 What is “this pointer” in
C++? What are the features of “this pointer”?
Answer: The this 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 and the data members are
allocated memory for all of their instances. This kind of
3 Explain destructor in
detail.
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
explicitly deleted. A destructor is a member function with the same name as its
class prefixed
Assignment
Set -2
1 What is Polymorphism?
What are the different types of Polymorphism?
Answer: Virtual functions in C++ are important to implement the concept of polymorphism.
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
2 Discuss the following
functions of file operations
a) tellg()
b) seekp()
c) ignore()
d) getline()
Answer: A. 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
<fstream.h>
void main() {
//if we have
"
3 Explain sequence
containers
Answer: Sequence Containers
There are three
types of sequence containers in
the STL. These, as their name suggests, store data in linear sequence. They are
the vector, deque and list:
·
vector<Type>
·
deque<Type>
·
list<Type>
Vector
#
Get fully solved assignment. Buy
online from website
online store
or
plz drop a mail with your sub
code
we will revert you within 2-3
hour or immediate
Charges rs
125/subject
No comments:
Post a Comment