CPP1
CPP1
P.T.O.
Q3) Attempt any Four of the following. (Out of Five) [4 × 4 = 16]
a) Write a C++ program to create a class which contains two data members.
Write member functions to accept, display and swap two entered numbers
using call by reference.
b) Write a C++ program to create a class Book which contains data members
as B–Id, B–Name, B–Author, B– publication. Write member functions
to accept and display Book information also display count of books.
(Use static data member to maintain count of books)
c) Write a C++ program to calculate square and cube of integer number by
using inline function.
d) Design C++ class which contains function display(). Write a program to
count number of times display() is called. (use static data member).
e) Write a C++ program to read contents of a text file and count number of
characters. Words and lines in a file.
[5803]-402 2
{
Cout <<"In the constructor\n'';
i = v;
}
Void print (Void)
{
Cout <<"The value of i is " <<<endl;
}
};
Void main ( )
{
abc a (10);
abc b ;
a. print ( );
b. print ( );
}
Q5) Write a short note on any two of the following : (Out of three) [2 × 3 = 6]
a) Exception Handling
b) Operator overloading
c) Pointer to object with example.
[5803]-402 3