Sunteți pe pagina 1din 4

b) Write a templated class for array and write a function for

searching for an object x in the array a.

UNIT-III
5. a) Distinguish between multiple inheritance, multilevel
inheritance, hierarchical inheritance and hybrid inheritance.
b) What is meant by copy constructor? How is it useful
in C++?

8
4

OR

6. Define an abstract class called length that defines length of an


object in millimeters. Then define two classes inherited from
length called m length and e length. m length has methods that
provide length of object in millimeter, centimeter and meters.
The e length has methods that provide the length of an object in
inches, feet and yards.
UNIT-IV
7. a) What are virtual functions? What are pure virtual functions?
Give examples in C++.
b) Explain the use of this pointer in C++. Give examples.

12

6
6

OR

8. a) Write short notes on memory management in C++.


b) What is a virtual destructor? When is it used in C++?

6
6

UNIT-V
9. a) Describe the key words provided by C++ for implementing
exception handling.
b) Define a function template that reverses an array of elements.
The function must use two arguments the type of array
(generic) and size of the array (int).

OR

10. a) Explain the use of nested class templates.


b) Describe the process of throwing parameterized objects of a
nested exception class.

6
6

[12456/II S/108]

[EURCS 206]

B.Tech. DEGREE EXAMINATION


II SEMESTER
OBJECT ORIENTED PROGRAMMING WITH C++
(Effective from the admitted batch 200809)
(Common for BT,Civil,ECE,EEE & EIE branches)
Time: 3 Hours
Max.Marks: 60
--------------------------------------------------------------------------------- --------------------Instructions: Each Unit carries 12 marks.
Answer all units choosing one question from each unit.
All parts of the unit must be answered in one place only.
Figures in the right hand margin indicate marks allotted.
-----------------------------------------------------------------------------------------------------

UNIT-I
1. Write a program in C++ to read a small positive integer n and to
print all possible truth values that can be assigned to n Boolean
variables. If n is 3, output should be 23 = 8 lines and each line
should contain possible truth value (TRUE, FALSE) of each of
the 3 Boolean variables.

12

OR

2. a) Explain the process of software evolution.


b) Distinguish between tokens, keywords and identifiers.
c) What are derived datatypes? Give examples.

4
4
4

UNIT-II
3. a) What is meant by function overloading? Is it different from
operator overloading? Explain.
b) Explain the parameter passing mechanisms in C++.
c) Describe the constructs in C++ to reflect encapsulation.

4
4
4

OR

4. a) Write a program to read a floating print number and to point


its floor, ceiling and the floating point number rounded to
two decimal digits.

b) Write a templated class for array and write a function for


searching for an object x in the array a.

UNIT-III
5. a) Distinguish between multiple inheritance, multilevel
inheritance, hierarchical inheritance and hybrid inheritance.
b) What is meant by copy constructor? How is it useful
in C++?

8
4

OR

6. Define an abstract class called length that defines length of an


object in millimeters. Then define two classes inherited from
length called m length and e length. m length has methods that
provide length of object in millimeter, centimeter and meters.
The e length has methods that provide the length of an object in
inches, feet and yards.
UNIT-IV
7. a) What are virtual functions? What are pure virtual functions?
Give examples in C++.
b) Explain the use of this pointer in C++. Give examples.

12

6
6

OR

8. a) Write short notes on memory management in C++.


b) What is a virtual destructor? When is it used in C++?

6
6

UNIT-V
9. a) Describe the key words provided by C++ for implementing
exception handling.
b) Define a function template that reverses an array of elements.
The function must use two arguments the type of array
(generic) and size of the array (int).

OR

10. a) Explain the use of nested class templates.


b) Describe the process of throwing parameterized objects of a
nested exception class.

6
6

[12456/II S/108]

[EURCS 206]

B.Tech. DEGREE EXAMINATION


II SEMESTER
OBJECT ORIENTED PROGRAMMING WITH C++
(Effective from the admitted batch 200809)
(Common for BT,Civil,ECE,EEE & EIE branches)
Time: 3 Hours
Max.Marks: 60
--------------------------------------------------------------------------------- --------------------Instructions: Each Unit carries 12 marks.
Answer all units choosing one question from each unit.
All parts of the unit must be answered in one place only.
Figures in the right hand margin indicate marks allotted.
-----------------------------------------------------------------------------------------------------

UNIT-I
1. Write a program in C++ to read a small positive integer n and to
print all possible truth values that can be assigned to n Boolean
variables. If n is 3, output should be 23 = 8 lines and each line
should contain possible truth value (TRUE, FALSE) of each of
the 3 Boolean variables.

12

OR

2. a) Explain the process of software evolution.


b) Distinguish between tokens, keywords and identifiers.
c) What are derived datatypes? Give examples.

4
4
4

UNIT-II
3. a) What is meant by function overloading? Is it different from
operator overloading? Explain.
b) Explain the parameter passing mechanisms in C++.
c) Describe the constructs in C++ to reflect encapsulation.

4
4
4

OR

4. a) Write a program to read a floating print number and to point


its floor, ceiling and the floating point number rounded to
two decimal digits.

S-ar putea să vă placă și