Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

C++ Question Bank

Download as pdf or txt
Download as pdf or txt
You are on page 1of 28

*12322C220* 12322/C220

III Semester B.C.A./B.Sc. (CS) Examination, Nov./Dec. 2011


OOPS USING C++
Time : 3 Hours Max. Marks : 80

Instructions : Answer any five complete questions.


Draw neat diagrams wherever necessary.

1. a) Discuss the advantages of Object Oriented Programming.


b) Explain features of Object Oriented Programming.
c) What are inline functions ? Write C++ program to calculate area and
circumference of circle using inline functions. (4+4+8=16)

2. a) Differentiate between pass by value and pass by reference.


b) Write a C++ program to illustrate function overloading.
c) What is friend function ? Explain the advantages of using friend
functions. (8+4+4=16)

3. a) What is constructor ? Explain the different types of constructors.


b) How do you pass objects as arguments ? Explain. (8+8=16)

4. a) Explain binary operator overloading with an example.


b) Write a C++ program to overload ‘++’ operator.
c) Discuss data conversion between class to class. (4+6+6=16)

5. a) What is inheritance ? Explain different visibility modes in derived class.


b) Write a C++ program to demonstrate single level inheritance. (8+8=16)

6. a) How do you define constructors in the multiple inheritance ?


b) What are templates ? Explain function templates and class templates with
example.
c) Write a note on virtual functions. (4+8+4=16)

P.T.O.
12322/C220 *12322C220*

7. a) Explain exception handling.


b) Discuss different file handling functions in C++.
c) Write a C++ program to implement area of geometrical figures. (6+6+4=16)

8. Write short notes on any four of the following :


a) Manipulators
b) Cin and cout
c) Hybrid inheritance
d) Overloading
e) Multiple inheritance. (4+4+4+4=16)

_______________
*32322C220* 32322/C 220
Reg. No.

III Semester B.C.A.3 Degree Examination, November/December 2017


OOPs USING C++
(Regular)

Time : 3 Hours Max. Marks : 80

Instructions : 1) All Sections are compulsory.


2) Draw neat diagrams wherever necessary.

SECTION – A

1. Answer any 10 questions of the following : (10×2=20)

a) What do you mean by data hiding ?

b) What are i/p and o/p operators ?

c) List the various access specifiers of C++.

d) What do you mean by function overloading ? Give an example.

e) Differentiate between pass by value and pass by reference.

f) Mention the operators that can not be overloaded.

g) What are the difference between classes and structures ?

h) What is type conversion ? Mention its types.

i) What do you mean by class containership ?

j) Define friend class with an example.

k) Define pure virtual function.

l) What is stream ? Mention its types.

P.T.O.
32322/C 220 *32322C220*

SECTION – B

Answer any 4 questions of the following : (4×5=20)

2. Explain any 5 basic concepts of OOP.

3. Define constructor overloading. Explain the same with an example.

4. Explain unary operator overloading with an example.

5. Explain file error handling functions.

6. Differentiate between function overloading and function overriding.

7. Write a CPP program to create a class time which has


a) Data members : Hours, Minutes, Seconds
b) Member functions : To read the time, display time and to add 2 time objects.

SECTION – C

Answer any 4 questions of the following : (4×10=40)

8. Write a CPP program to read the data of ‘N’ employees and compute the net
salary of each employee.
(DA 60% of Basic, IT 15% of Gross, HRA 20% of Basic)
Given that an employee class contains the following members.
a) Data members : Emp No., Emp Name, Basic sal, DA, IT, HRA, NetSal.
b) Member Functions : To Read the data, to compute net salary and to print data
members. 10

9. Define constructor and explain types of constructor. 10

10. a) Write a CPP program to concatenate and compare two strings using ‘+’ &
‘==’.
b) What are the limitations of increment operator ? (5+5)

11. Define inheritance. Explain the types of inheritance. 10

12. a) What do you mean by template ? Explain with an example.


b) Define virtual function and explain with an example. (5+5)

_____________
*22322C220* 22322/C 220
Reg. No.

III Semester B.C.A.2 Degree Examination, Nov./Dec. 2016


(Repeaters)
OOPS USING C++

Time : 3 Hours Max. Marks : 80

Instructions : 1) All Sections are compulsory.


2) Draw neat diagrams wherever necessary.

SECTION – A

Answer any ten questions of the following. (10×2=20)

1. Mention applications of OOP.

2. What are default arguments ?

3. Write the syntax of switch statement. Also give an example.

4. Define a class. Write its syntax.

5. What is constructor overloading ? Give an example.

6. What is a static data member ?

7. What is operator overloading ?

8. What is a conversion function ? Write its syntax.

9. Define inheritance. Give an example.

10. What is class containership ?

11. Define an exception.

12. What are command line arguments ?


P.T.O.
22322/C 220 *22322C220*

SECTION – B

Answer any six questions of the following : (6×5=30)

13. Define OOP. Explain its main characteristics.

14. What is a friend function ? Write a C++ program to swap two numbers using
friend function.

15. Explain various access specifiers used in C++.

16. Differentiate between a constructor and destructor.

17. Write a C++ program to concatenate and compare two strings using + and = = .

18. Explain ambiguity resolution in inheritance.

19. What are class templates ? Write a program to demonstrate class templates.

20. Explain various error handling functions with respect to files.

SECTION – C

Answer any three questions of the following : (3×10=30)

21. Explain any five basic concepts of OOP.

22. Write the syntax and example of the following :


a) While loop.
b) Class.
c) Pure virtual function.
d) Destructor
e) Switch case.

23. Explain with an example how do you convert one class type to another class type.

24. Explain in brief the following types of inheritance along with an example.
a) Hierarchical Inheritance.
b) Single Inheritance.

25. Write any two short notes :


a) Manipulators b) Exception Handling
c) Inline Functions d) Function Overloading

______________
*22322C220* 22322/C 220
Reg. No.

III Semester B.C.A. 2 Examination, October/November 2013


(Regular and Repeater)
OOPs USING C++
Time : 3 Hours Max. Marks : 80

Instructions : 1) All Sections are compulsory.


2) Draw neat diagrams wherever necessary.

SECTION – A

Answer any ten questions of the following : (2×10=20)

1. What is dynamic initialization of a variable. Give an example.


2. Define reusability.

3. What are memory management operators ?


4. State the significance of friend function.
5. What is copy constructor ?

6. Define the term class with its syntax.


7. How do you convert from basic type to class type ?
8. What is polymorphism ?

9. What are templates ?


10. Write the syntax to derive the derived class D from the base class B.
11. What is virtual function ?

12. What is the significance of tell g ( ) ?

SECTION – B

Answer any six questions of the following : (5×6=30)

1. Explain characteristics of OOP.

2. Write a program to swap two characters using pass by reference.


P.T.O.
22322/C 220 *22322C220*

3. Differentiate between constructors and destructors.

4. Write a program to print sum of even and odd numbers. (Use the class concept.)

5. Write a program to overload the operator ‘++’ using unary operator overloading.

6. How do you access data and member functions using ‘this’ pointer ?

7. Explain the various ways of opening a file.

8. Explain exception handling mechanism.

SECTION – C

Answer any three questions of the following : (3×10=30)

1. Explain function overloading ? Write a program to overload a function volume


and find :
a) Volume of a box
b) Volume of solid cylinder
c) Volume of hollow cylinder.

2. a) What is constructor ? Explain different types of constructors used in C++.


b) Write a program to create a class time which has :
a) Data members : Hours, Minutes, Seconds.
b) Member function : To read the time, To write time and to add two time
objects. (4+6)

3. a) What are the limitations of increment operator ? Differentiate between post


fix and prefix operators. Give example for each.
b) Describe Binary Operator overloading with an example. (5+5)

4. What is inheritance ? Explain levels of inheritance.

5. What is stream ? Explain stream class hierarchy.

_______________
*12322C220* 12322/C 220
Reg. No.

III Semester B.C.A. Examination, Oct./Nov. 2012


OOPs USING C++
Time : 3 Hours Max. Marks : 80

Instructions : 1) Answer any five complete questions.


2) Draw neat diagrams wherever necessary.

1. a) Differentiate between Procedure Oriented Programming and Object Oriented


Programming.
b) Explain cin and cout.

c) What is a class ? Explain syntax of the class with an example. (6+4+6=16)

2. a) Define in-line functions. State its advantages and limitations.


b) What is friend function ? Give the syntax of friend function with an example.
c) Write a C++ program to find largest among 2 numbers using friend
function. (6+6+4=16)

3. a) Give the difference between constructor and destructor.

b) What is function overloading ? Explain function overloading with an example.


c) Discuss the different ways of passing arguments to a function. (4+6+6=16)

4. a) How do you return objects from the class ?


b) Describe the concept of class visibility.

c) Write a C++ program to add two distance variables. (4+6+6=16)

5. a) Explain unary operator overloading with an example.


b) Discuss the limitations of increment operator.
c) Write a C++ program to overload '+' operator. (5+3+8=16)
P.T.O.
12322/C 220 *12322C220*

6. a) What is overriding member function ?


b) Define inheritance. Explain different levels of inheritance.
c) Write a C++ program to illustrate multiple inheritance. (2+8+6=16)

7. a) What are templates ?


b) Explain exception handling in C++.
c) With a neat diagram explain stream class hierarchy. (2+6+8=16)

8. a) What is the use of 'this' pointer ? How do you access member data and
member function using 'this' pointer ?
b) Explain the following with example :
1) Conversion from basic type to class type.
2) Conversion from class type to basic type.
c) Write a C++ program to concate two strings. (5+6+5=16)

———————
*22322C220* 22322/C 220

Reg. No.

III Semester B.C.A.2 Degree Examination, November/December 2017


OOPS USING C++
(Repeater)
Time : 3 Hours Max. Marks : 80

Instructions : 1) All sections are compulsory.


2) Write the syntax and examples wherever necessary.
3) Draw diagrams wherever necessary.

SECTION – A

Answer any 10 questions of the following. (10×2=20)

1. What are memory management operators ? State their use.

2. Mention any 4 applications of OOPS.

3. Write the syntax to derive the derived class D from the base class B.

4. Name the operators that cannot be overloaded.

5. Write the syntax of function prototype. Give an example.

6. Mention various file operations.

7. State the significance of friend function.

8. What is pure virtual function ? Give its syntax.

9. What are command line arguments ?

10. What is constructor overloading ? Give example.

11. What is the significance of tellp() ?

12. How do you convert a basic type to class type ?

P.T.O.
22322/C 220 -2- *22322C220*

SECTION – B

Answer any 6 questions of the following. (6×5=30)

13. Write a C++ program to demonstrate the use of function overloading.

14. Explain briefly file error handling operations.

15. With the help of an example, explain exception handling mechanism.

16. Write a C++ program to swap two integers using friend function.

17. Differentiate between POP and OOP.

18. What are templates ? Explain briefly the types with syntax.

19. Write a C++ program to overload the operator ‘++’ using unary operator
overloading.

20. Differentiate between a constructor and destructor.

SECTION – C

Answer any 3 questions of the following : (3×10=30)

21. a) What are inline functions ? Write a program using inline function to find square
and cube of a give integer number. 5

b) Discuss the special characteristics of a friend function. 5

22. What is inheritance ? explain briefly with syntax the various forms of inheritance. 10

23. a) What is operator overloading ? Explain the syntax of operator function with
the help of an example. 5

b) Write a program to illustrate the use of conversion from class type of basic
type. 5
*22322C220* -3- 22322/C 220

24. Answer any 5 of the following. (5×2=10)

a) Class and object

b) Virtual base class


c) Dynamic binding
d) Stream class
e) Array of objects
f) File pointers.

25. a) Describe briefly any 5 basic concepts of OOPs. 5

b) Write a program to illustrate the use of static data members and static member
functions. 5

–––––––––––––––––––
*12322C220* -1- 12322/C 220P

Reg. No.

Third Semester B.C.A. Degree Examination, October/November 2013


OOP’s USING C++ (Repeaters)

Time : 3 Hours Max. Marks : 80

Instruction : Answer any five full questions.

1. a) What is procedure oriented programming ? What are its main characteristics ?


b) Explain the basic concepts of OOP.
c) Define OOP. (6+8+2=16)

2. a) What is in-line function ? State its advantages.


b) Explain with an example the input and output operators in C++.
c) What are default arguments ? Write a program to demonstrate default
arguments. (4+4+8=16)

3. a) What is a class ? Write the syntax for declaring class with an example.
b) How do you pass objects as arguments ? Explain with an example.
c) Write a program to illustrate function overloading. (4+8=4=16)

4. a) Explain data conversion between class type to basic type.


b) Write a C++ program to overload binary operators.
c) What are the rules for operator overloading ? (6+6+4=16)

5. a) What is inheritance ? Explain different visibility modes in derived classes.


b) Write a program to create a student report using inheritance. (8+8=16)

6. a) What is dynamic binding ? Explain how it can be achieved by virtual functions.


b) Define a template. Write a C++ program to sort an array using templates.
(8+8=16)

7. a) Explain exception handling mechanism in C++.


b) Explain file error handling operations.
c) What are input and output streams ? (6+6+4=16)

P.T.O.
12322/C 220 *12322C220*

8. Write any four short notes :


a) Manipulators.
b) Friend functions.
c) Scope resolution operator.
d) Call by reference.
e) This pointer.
f) Command line arguments. (4+4+4+4=16)

_______________________
*32322/C22* (1) 32322/C22
Reg. No.

III Semester B.C.A 3 Degree Examination, Nov./Dec. - 2019


OOPS USING C++
(Repeaters)
Paper: BCA 3

Time : 3 Hours Maximum Marks : 80


Instructions to Candidates:
All sections are Compulsory
SECTION- A
Answer Any TEN questions of the following: (10×2=20)
1. a) What is class write its syntax?
b) What are memory management operators?
c) What is function overloading?
d) Define inline Function.
e) What is Destructor?
f) List the various Access specifiers of C++
g) Define operator overloading.
h) Define Inheritance.
i) Define pure virtual functions.
j) Define stream.
k) Define exception.
l) What is containership?
SECTION - B
Answer Any FOUR questions of the following: (4×5=20)
2. Differentiate between oop and pop.
3. Explain call by value parameter passing mechanism with an example.
4. What is Friend Function? Write syntax to declare Friend Function & write any two of its characteristics.
5. Explain unary operator overloading.
6. Explain file error handling functions.
7. Explain different visibility modifiers in C++
P.T.O.
*32322/C22* (2) 32322/C22

SECTION- C
Answer Any Four questions of the following: (4×10=40)
8. Explain Basic concepts of oop’s. (10)
9. Explain different types of Inheritance. (10)
10. What is constructor? Write a cpp program to overload constructors. (10)
11. a) Explain exception handling mechanism. (5)
b) Explain class Templates with an example. (5)
12. Write a cpp program to Add two complex numbers using Friend Function. (10)

__________________

P.T.O.

You might also like