[go: up one dir, main page]

0% found this document useful (0 votes)
50 views4 pages

BCA-241:Object Oriented Programming and C++ S.Y. B.C.A. (Science)

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 4

Total No. of Questions :4| SEAT No.

P5254 |Total No. of Pages :4


[5826]-401
S.Y. B.C.A. (SCIENCE)
BCA- 241 :Object Oriented Programming and C++
(2019 Pattern) (Semester - IV)
Time:3 Hours) IMax. Marks : 70
Instructions to the candidates:
All questions are compulsory
2) Figures to the right indicate full marks.

Ql) A) Choose the correct option. |5 x1=5]


are basic run time entities.
a Data b) Classes
c) Objects d) None
ü) The Dynamic Memory allocation can be done through
operator.
a) new b) delete
C) pointer d) break
i) Constructor are used to the object.
a) Increment b) Initialize
c) Destroy d) Decrement
iv) An exception is error.

a) syntax b) logical
c) runtime d) physical
v) When the object of derived class is created then the order of
constructor execution is
a base to derived b) derived to base
c) intermediate to base d) bottom to top
B) Answer the following,. (5 x 1=5]
List different types of polymorphism.
What is the purpose of scope resolution operator.
Enlist any two fill operations.
iv) Write syntax of reference variable.
v) List any two operator which should be overloaded as a member
function.
PT0.
92) Answer the following [Any Five] (5 x3= 15]
a) What is Manipulator? Enlist them with example.
b) Write advantage and Disadvantage of Inline function.
c) How to handle an exception in C++.
d) Explain difference of constructor and destructor.
e) Explain the usage of'this' pointer with example.
f) Read the code carefully and answer the question.
Class A
int a,b,
public :
A)
a= 0:
b= 0;

A(int x,int y)
a =;

b=y;

Void display ()

cout <<a<<b<<end 1.

:
main()

Aa;
statement 1:
statement 2:

1) How many member functions are defined in the above code.


How will you write statement 1 to invoke parametrized constructor.
iü) How will you write statement 2 to invoke display function.

[5826]-401 2
03) Answer the following (Any five) |5 x 4 = 20]
a) Write a C++ program to count number of vowels in a text file.
b) Write a program to find sum of numbers between I to n using constructor
where value of n will be passed to the constructor.
c) What is copy constructor? Explain with the help of example.
d) Explain function overloading with example.
e) What is class? Explain access specifiers use in it with example.
What is friend function? Explain with properties and example.
g) What is pure virtual function? Explain with suitable example.

04) Answer the following (Any five) |5 x 5 = 25]


a) Write C+t program for how the unary minus operator is overloaded.
b) Explain hybrid Inheritanec with example.
c) Explain in short
Object and classes
Data hiding
Data Abstraction and Encapsulation
d) Differentiate between class and structure.
e) Define operator overloading. Give its syntax and write the rules for
operator overloading.
Write a C++ program to accept student information as sno, sname, subl
and sub2 for five students using array of objects calculate total marks
and display students with maximum percentage
Trace the output and justify.
#include <iostream>
int &fun()

static int a = 10;


return a;

int main()

int & y= fun ( );


y=y+30;
cout << fun ():
return 0;

[5826]-401 3
ii) # include <iostream>
using namespace std;
class p

Public:
void print ()
cout <<"Inside p:";}

class Q:public p
public :
Void print ( )

Cout<< "Inside Q";}

class R : public Q

int main (void)

Rr;
r. print ( ):
return 0;

O000

[5826|-401 4

You might also like