0% found this document useful (0 votes)
58 views2 pages

Object Oriented Programming Through C++ Feb 2022

This document contains instructions for a C++ programming exam. It provides 10 questions divided into 2 sections, with students required to answer 5 questions by choosing either part a or b from each question. The questions cover a range of C++ and object-oriented programming concepts like OOP vs procedural programming, classes, inheritance, polymorphism, operator overloading, templates, and exceptions. Students have 3 hours to complete the exam worth a total of 70 marks.

Uploaded by

dileepvikram143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views2 pages

Object Oriented Programming Through C++ Feb 2022

This document contains instructions for a C++ programming exam. It provides 10 questions divided into 2 sections, with students required to answer 5 questions by choosing either part a or b from each question. The questions cover a range of C++ and object-oriented programming concepts like OOP vs procedural programming, classes, inheritance, polymorphism, operator overloading, templates, and exceptions. Students have 3 hours to complete the exam worth a total of 70 marks.

Uploaded by

dileepvikram143
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Code No: R2021051 R20 SET - 1

II B. Tech I Semester Regular Examinations, Feb/March - 2022


OBJECT ORIENTED PROGRAMMING THROUGH C++
(Com to CSE, IT)
Time: 3 hours Max. Marks: 70
Answer any FIVE Questions each Question from each unit
All Questions carry Equal Marks
~~~~~~~~~~~~~~~~~~~~~~~~~

1 a) Differentiate between Object Oriented Programming and Procedural Oriented [7M]


Programming.
b) Explain Advantages of Object Oriented Programming. [7M]

Or
2 a) Explain the key concepts of Object Oriented Programming. [7M]
b) Differentiate between C and C++. [7M]

3 a) Explain the following with an example. [7M]


i. Scope resolution operator
ii. Compound Assignment operator
iii. Type cast operator
b) Write a C++ program using function overloading to find the area of a Rectangle, [7M]
Square .
Or
4 a) class Student [7M]
{
private:
char regdno[10],name[30];
int marks;
public:
void setDetails() int getMarks()
{ {
….. ….
} }

}
main()
{
..
}
Complete the above program to find the average of marks for 10 students.
b) What is a Constructor? Discuss various constructors with examples. [7M]

5 a) Explain about multi level inheritance with an example. [7M]


b) Give the general syntax of operator overloading function and list the operators that [7M]
cannot be overloaded.
Or
6 a) Explain about protected inheritance with an example. [7M]
b) What is operator overloading? Write a program for overloading unary plus [7M]
operator.
1 of 2
|''|'||||''|'''|||'|
Code No: R2021051 R20 SET - 1

7 a) What are the rules for Virtual functions? What is the importance of Virtual [7M]
Destructor?
b) Explain in detail how the members of class can be accessed using the pointers to [7M]
base class and derived class.
Or
8 a) Analyze the following code and find the output and justify your answer [7M]

class A class B : public A class C: public B


{ { {
public: public: public:
virtual void f1() void f1() void f1() { cout <<
{ cout << "A::f1" << { cout << "B::f1" << "C::f1" << endl; }
endl; } endl; } void f2() { cout <<
void f2() virtual void f2() "C::f2" << endl; }
{ cout << "A::f2" << { cout << "B::f2" << };
endl; } endl; }
}; };
int main()
{
B *b = new C();
b->f1();
b->f2();
return 0;
}
b) Explain in detail about this pointer to base class and derived class. [7M]

9 a) Write a function template to perform bubble sort. [7M]


b) Demonstrate handling of exception with multiple catch blocks. [7M]

Or
10 a) Discuss various exception handling mechanisms. [7M]
b) Implement function template to find a given element in the array. [7M]
Note : array may be int or float.

2 of 2

|''|'||||''|'''|||'|

You might also like