TA
[This question Depot contains 12 printed pages. ]
Sr. No. of Question Paper :
Unique Paper Code
Name of the Paper
Name of the Course
Semester
Duration : 3 Hours
(iy
Your Roll No...,.......-.--
4076 H
2342011201
Object Oriented Programming
with C++ (DSC-04)
B.Sc. (H) Computer Science
I
Maximum Marks : 90
Instructions for Candidates
1. Write your Roll No. on the top immediately on receipt
of this question paper.
2. Section A is compulsory (Question 1).
3. Attempt any 4 questions from Section B (Questions
2 to 6).
4. Parts of a question must be answered together.
PPO;4076 2
Section A
(Compulsory Question)
1. (a) Write a code snippet to do the following: (3)
* Declare str, a pointer to char and initialized
to the value “NITIN”.
+ Display the ASCII value of each character
of the pointer str.
(b) What will be the output after executing the
following code segments? Assume all the required
header files have been included. (3*6=18)
@ double sal[]=(3415.5, 6718.8, 7911.5};
double total=0;
for (int k=Q; k<3; k++)
totalt=sal[k];
cout << "The total salary is" << total;
(ii) for (int j=1ij<-4;j5++)
{
for(int k=1;k<=j;k=k+2)
cout<<(j+k);
cout<
x-=x7
this->y=y;
cout<x<y<=500 else the message, “unable to
debit, the minimum balance should be 500” is
printed,
(iv) void deposit (double x) :; This function credits
(adds) x to the balance.
(v) void display() : This function prints all account
details of a given bank account object,
Write a main function to create the Bankaccount
objects and illustrate the usage of the above functions,
(a) Give the output of the following code : (5)
class Figure
{
protected:
double area;
public :
Figure ()
9
cout<<"Figure Constructor";
area=07
?
virtual void display()=0;
Ve
class circle: public Figure
{
double radius;
public:
circle(double r)
{
cout<<"Inside Circle Constructor"<