Object Oriented Programming and Desigbn Question Bank Unit - I Object and Classes
Object Oriented Programming and Desigbn Question Bank Unit - I Object and Classes
QUESTION BANK
UNIT – I
PART – A (2 MARKS)
2. Define Objects.
8. Define Inheritance.
9. Define Polymorphism.
16. List out the four basic sections in a typical C++ program.
18. Define identifier. What are the rules to be followed for identifiers?
PART – B
2. Explain the use of constant pointers and pointers to constant with an example.(11)
3. a. State the differences between class and struct and also illustrate with an example. (6)
pointers? (6)
7. Explain about call by reference and return by reference with program. (11)
8. Explain Nested classes and local classes with an example (11)
9. Explain in detail about control structures with eg.(11)
10. Write a program to evaluate the following function
Sin(x) = x - x3 /3! + x5 /5! – x7 /7! + ….
11 a) What is a friend function . What are the merits and demerits of using friend function?(5)
b) Write a program to explain the inline function (6)
13. Explain in detail about formatted and unformatted console I/O operations (11)
PART – A (2 MARKS)
1. Define Constructor.
6. Define Destructor.
PART – B
1. a. Explain the copy constructors with an example? (6)
b. Explain explicit Constructors, Parametrized Constructors, and multiple Constructors with
suitable example. (6)
4. Write a program to add two complex numbers using operator overloading concept
5. Create a class vector to hold an array of integers and perform the following operations
using constructor for dynamic allocation of array based on size given as argument
c) Multiply all elements in the vector by a given number X and display the resultant vector
6. Write a C++ program to find the area of various 2D shapes such as square, rectangle,
triangle, circle and ellipse using function overloading.
PART – A (2 MARKS)
PART – B
7.a)Explain in detail about the various run time casting in C++ (6)
b) Write a C++ program for calculating the are of rectangle and circle using run time
polymorphism (5)
8.a) Write a program in C++ to read two strings and perform the following string
manipulation function (7)
b) Explain in detail about dynamic objects. How are they created ? (4)
UNIT – III
Pointers and arrays , Memory , Polymorphism
1. What is a pointer . Give eg.
UNIT – IV
FILE MANIPULATION
PART – A ( 2 MARKS )
1. Define manipulators and also mention the manipulators that are used in C++.
5. What are the two methods available for opening the files?
9. What is STL?
11. What are the ways that a string object can be created?
PART – B
7. a) Explain in detail about exception handling in C++ with suitable code (6)
b) Write a C++ program using function template to find the product of two integer or
floating point type of data(5)
8. Create a class Player with data members are playerid, playername, playergame and
member functions are getplayer(), searchplayer(), and displayplayer() . Use file to store N
players information and perform those operations
10. Write a program to read and write an array of integers into binary file (11)
PART – A (2 MARKS)
1. What is the need for template function in C++? What are their advantages?
PART – B
6. When do we need multiple catch blocks for a single try block? Give an example? (11)
UNIT –V
OBJECT MODELLING AND OBJECT ORIENTED SOFTWARE DEVLOPMENT
PART – A ( 2 MARKS )
Part – B
1. Draw and explain the class diagram for a simple banking application
2. Explain interaction diagrams with an eg.
3. Derive the use case model for student course registration system in a University with
proper interaction and activity diagram which include the following tasks publication
of courses offered, student enrolment for courses, attendance maintenance, conduct of
exams and marks maintenance and result publication
4. a) Explain in detail about patterns with an ex. (4)
5. How an activity and state chart diagrams are used for modelling ?(7)Explain the
interaction and state chart diagram of UML
6. Explain the concept of Interaction modelling
7. Write a detailed note on use case diagram with suitable eg.
8. Construct an UML use case diagram to withdraw amount in ATM banking.
9. Design sequence and collaboration diagram for issue and return of books in library.