Object Oriented Programming - Unit Wise Questions

Unit 1: Introduction to Object Oriented Programming
15 Questions

1. What is object oriented programming? Explain objects, class, encapsulation, data hiding, inheritance, and polymorphism.

10 marks | Asked in Model Question

1. Discuss the feature of the Object-Oriented Programming. Differentiate between Object Oriented Programming and Procedural Oriented Programming.

10 marks | Asked in 2067

1. What are the main features of the Object-Oriented Programming? Explain with suitable practical examples.

10 marks | Asked in 2068

1. Why do we need object oriented programming? How can we use inheritance to reuse already written and tested code in programs? Discuss with suitable example. (3+3+4)

10 marks | Asked in 2071

1. Differentiate between structural programming approach and object oriented programming approach. Explain the inheritance, polymorphism with example.

10 marks | Asked in 2069

1. Write any four features of object-oriented programming. Differentiate between operator overloading and function overloading.

10 marks | Asked in 2070

1. Explain the object oriented programming with its advantages. What are the features of object oriented languages? Explain.

10 marks | Asked in 2072

1. Discuss the feature of Object-Oriented Programming. Differentiate between Object Oriented   Programming and any other programming language that you know.

10 marks | Asked in 2075( Old Course)

1. What is object-oriented approach? How is it different from structured programming approach? Discuss the features of object-oriented languages in detail.

10 marks | Asked in 2073

1. Write down the features of  object oriented programming language and explain.

10 marks | Asked in 2074

1. Explain in detail the following principles of Object-Oriented Programming. 

    i. Data encapsulation and data hiding. ii. Inheritance and polymorphism. iii. Abstraction

10 marks | Asked in 2066

4. Explain abstraction with example.

5 marks | Asked in 2073

4. What is structured programming? Discuss characteristics and problems associated with structured programming.

5 marks | Asked in 2078

4. How object oriented programming differs from object based programming language? Discuss benefits of OOP.

5 marks | Asked in 2076

11. How can we define our functions inside the namespace and use them outside?

5 marks | Asked in 2070

Unit 2: Basics of C++ programming
38 Questions

2. How can you convert the user defined data type into primitive data type and vice versa? Explain both conversion routine with suitable example.

10 marks | Asked in 2075( Old Course)

2. Why do we need the preprocessor directive # include < io stream >? Describe the major parts of a C++ program.

10 marks | Asked in 2070

3. What do you mean by overloading of a function? When do we use this concept? Explain with example.

10 marks | Asked in 2070

3. What is function overloading? How is it different from function overriding? Write a program that gives an example of function overriding.

10 marks | Asked in 2073

3. Why data conversion is needed? Write a program to convert kilogram into gram using user define to user define data conversion.(1 kg = 1000 gm).

10 marks | Asked in 2074

4. Explain the purpose of a namespace with suitable example.

5 marks | Asked in Model Question

5. What is the principle reason for passing arguments by reference? Explain with suitable code.

5 marks | Asked in Model Question

4. Explain the do while structure.

5 marks | Asked in 2069

4. What is type casting? Explain with suitable example.

5 marks | Asked in 2066

5. What is function overloading? Explain with suitable example.

5 marks | Asked in 2068

5. Explain the inline function with example.

5 marks | Asked in 2069

5. Explain with example of an inline function.

5 marks | Asked in 2070

5. What is library function? How is it different from user defined function?

5 marks | Asked in 2071

5. Explain do/while structure with example.

5 marks | Asked in 2072

5. What is function overloading ? Explain with example.

5 marks | Asked in 2074

6. What is library function? How is it different from user defined function? 

5 marks | Asked in 2071

6.What is function? Write a program to find greatest number among any three numbers using function.
5 marks | Asked in 2074

6. Why type conversion is necessary in OOP? Explain with example, the type conversion routine.

5 marks | Asked in 2067

6. Discuss relationship between pointers and arrays.

5 marks | Asked in 2073

6. Explain the Inline function with example.

5 marks | Asked in 2072

7. Explain about this pointer with suitable example.

5 marks | Asked in 2075( Old Course)

5. What is the use of new and delete operators? Illustrate with example. What are advantages of new malloc.


5 marks | Asked in 2076

6. What is meant by pass by reference? How can we pass arguments by reference by using reference variable? Illustrate with example.

5 marks | Asked in 2078

7. Differentiate between structure and class in terms of access modifier

5 marks | Asked in 2070

7. Explain the use of inline function with example.

5 marks | Asked in 2073

7. Discuss the use of inline function with example.

5 marks | Asked in 2071

5. What is the principle reason for using default arguments in the function? Explain how missing arguments and default arguments are handled by the function simultaneously?

5 marks | Asked in 2075 |

6. What is meant by return by reference? How can we return values by reference by using reference variable? Illustrate with examples.

5 marks | Asked in 2076

6."An overloaded function appears to perform different activities depending the kind of data send to it" Justify the statement with appropriate example.

5 marks | Asked in 2075

9. Differentiate between overriding vs overloading.

5 marks | Asked in 2070

9. Differentiate between macro and function.

5 marks | Asked in 2072

9. Explain with example, how you create space for array of object using pointers?

5 marks | Asked in 2069

8. What is this pointer? How can we use it for name conflict resolution?Illustrate with example.

5 marks | Asked in 2076 |

10. Explain the use of break and continue statements in switch case statements in C++.

5 marks | Asked in 2072

11. Write a program to demonstrate the use of default argument  in functions.

5 marks | Asked in 2075( Old Course)

11. Explain the different storage classes in C++.

5 marks | Asked in 2072

12. How can you differentiate a macro with an inline function? Are they same or different? Justify.

5 marks | Asked in 2075( Old Course)

13. What are the major differences between overriding and overloading?

5 marks | Asked in 2069

Unit 3: Classes & Objects
27 Questions

1. Write a program according to the specification given below:

    - Create a class Account with data members acc no, balance, and min_balance(static)

    - Include methods for reading and displaying values of objects

    - Define static member function to display min_balance

    -Create array of objects to store data of 5 accounts and read and display values of each object

10 marks | Asked in 2078

2. Why constructor and destructor are required on Object Oriented Programming? Explain with  suitable example. 

10 marks | Asked in 2066

2. Discuss features of class and object. Design a class to represent a bank account with data members name, account-number, account-type, and balance and functions to assign initial values, to deposit an amount, to withdraw an amount after checking balance, and to display the name and balance. (4+6)

10 marks | Asked in 2071 |

2. What is constructor? Explain their types? Discuss user defined parameterized constructor with suitable example.

10 marks | Asked in 2067

2. How is a member function of a class defined? Define friend function. What are the merits and  demerits of using friend function? Explain.

10 marks | Asked in 2069

2. Explain the role of constructor and destructor in Object-Oriented Programming. Discuss user defined parameterized constructor with suitable example.

10 marks | Asked in 2068

1. Explain the concept of user-defined to user-defined data conversion rotine located in the destination class.

10 marks | Asked in 2075

3. Create a class Stack with suitable data members and member functions to push and pop the elements of the stack. Add the exception when user tries to add item while the stack is full and when user tries to delete item while the stack is empty. Throw exception in both of the cases and handle these exception.

10 marks | Asked in 2075( Old Course) |

3. Define constructor, list some of the special properties of the constructor functions

10 marks | Asked in 2069

4. What is constructor ? Write a program to demonstrate constructor overloading. 

5 marks | Asked in 2074

4. How can you classify objects? Why dynamic objects are needed?

5 marks | Asked in 2067

4. Why dynamic object is needed? Explain with suitable example.

5 marks | Asked in 2068

6. Why constructor is needed? Explain different types of constructors with example.

5 marks | Asked in Model Question

4. What do you mean by dynamic initialization of variables?

5 marks | Asked in 2070

5. Explain about the importance of constructors and destructors with their execution sequence.

5 marks | Asked in 2075( Old Course) |

6. How is dynamic initialization of objects achieved?

5 marks | Asked in 2069

7. What are the importance of destructors?

5 marks | Asked in 2069

8. What is class? Differentiate it with object.

5 marks | Asked in 2073

8. What are the characteristics of constructor?

5 marks | Asked in 2070

8. What is constructor? Differentiate it with destructor.

5 marks | Asked in 2071

7. What is constructor? Explain the concept of default and default copy with suitable example.

5 marks | Asked in 2078

8. Explain the static class members with example.

5 marks | Asked in 2072

9. Explain about accessing a member function outside a class with example.

5 marks | Asked in 2071

9. How can you define a member function outside a class ? Explain with suitable example. 

5 marks | Asked in 2073

7. Explain the default action of the copy constructor. Write a suitable program that demonstrates the technique of overloading the copy constructor. 

5 marks | Asked in 2075

7. What is destructor? Write a program to show the destructor call such that it prints the message "memory is released".

5 marks | Asked in 2076 |

9. Create a real scenario where static data members are useful. Explain with suitable example.

5 marks | Asked in 2075

Unit 4: Operator Overloading
11 Questions

2. Explain operator overloading. Write a program that overloads insertion and extraction operators.

10 marks | Asked in Model Question

2. Write a program to overload the unary minus operator using friend function.

10 marks | Asked in 2072

2. What is meant by type conversion? Define two way of converting one user defined data type (object) to another user defined object? Write a program that converts object of another distance class with data members feet and inch.(Assume 1m = 3.3 feet and 1cm = 0.4 inch)

10 marks | Asked in 2078

2. Explain the concept of operator overloading? List the operators that cannot be overloaded. Write programs to add two object of distance class with data members feet and inch by using by using member function and friend function.

10 marks | Asked in 2076 |

3. What is operator overloading? What are the benefits of operator overloading? How is operator overloading different from function overloading. Write a program that shows an example of function overloading. (2+2+2+4)

10 marks | Asked in 2071

7. Write a program that illustrates the conversions between objects of different classes having conversion function in source object.

5 marks | Asked in Model Question

5. Write a program to compute subtraction of two complex numbers using operator overloading.

5 marks | Asked in 2066

5. What is operator overloading? Explain their types with suitable examples.

5 marks | Asked in 2067

8. What is an operator function? Explain with syntax.

5 marks | Asked in 2069

10. Write a program that increases an integer value by 1 (one) overloading + + operator.

5 marks | Asked in 2073

10. Explain the role of operator overloading with example.

5 marks | Asked in 2074

Unit 5: Inheritance
23 Questions

2. How can we use inheritance for code reusability? Discuss multiple inheritance with suitable example. 

10 marks | Asked in 2073

1. Write a program according to the specification given below:

  •  Create a class Teacher with data members tid & subject and ember functions for reading and displaying data members.
  • Create another class Staff with data members sid & position, and member function for reading and displaying data members.
  • Derive a class Coordinator from Teacher and Staff and the class must have its own data member department and member functions for reading and displaying data members.
  • Create two object of Coordinator class and read and display their details.
10 marks | Asked in 2076 |

2. Differentiate between single inheritance and multiple inheritance? Imagine a college hires some lectures. Some lectures are paid in period basic, while others are paid in month basic. Create a class called lecture that stores ID and name of lectures. From this class derive two classes: part time, which adds payperhr(type float): and full time, which adds paypermonth(type float). Each of these three classes should have a readdata() function to get its data from user at the key board and printdata() function to display the data.

Write a main() program to test the Full time and Part time classes by creating instance of them asking the user to fill their data with readdata () and display the data with printdata().

10 marks | Asked in 2074 |

3. What is inheritance? Explain the ambiguities associated with multiple inheritance with suitable example programs.

10 marks | Asked in Model Question

2. Depict the difference between private and public derivation. Explain derived class constructor with suitable program.

10 marks | Asked in 2075

3. How ambiguity arises in multipath inheritance? How can you remove this type of ambiguity? Explain with suitable example.

10 marks | Asked in 2078

3. Define a student class (with necessary constructors and member functions) in Object Oriented Programming (abstract necessary attributes and their types). (Write a complete code in C++  programming language).

• Derive a computer Science and Mathematics class from student class adding necessary attributes (at least three subjects). 

• Use these classes in a main function and display the average marks of computer science and mathematics students.

10 marks | Asked in 2066

3. Define a clock class (with necessary constructors and member functions) in Object Oriented  Programming (abstract necessary attributes and their types). (Write a complete code in C++ programming language). 

  • Derive a wall_clock class from clock class adding necessary attributes. 
  • Create two objects of wall_clock class with all initial state to 0 or NULL.
10 marks | Asked in 2067

3. Define a Shape class (with necessary constructors and member functions) in Object-Oriented Programming (abstract necessary attributes and their types). (Write a complete code in C++ programming language) 

• Derive Triangle and Rectangle classes from Shape class adding necessary attributes. 

• Use these classes in a main function and display the area of triangle and rectangle.

10 marks | Asked in 2068

3. Explain the role of inheritance in object oriented programming. What is public, private and protected dentation? Explain.

10 marks | Asked in 2072

4. Explain the syntax and rules of multiple inheritance in C++ with example.

5 marks | Asked in 2072 |

8. Explain the difference between private and public inheritance with suitable diagram.

5 marks | Asked in Model Question

7. Differentiate between super class and sub class with suitable examples.

5 marks | Asked in 2066

7. What is Inheritance? Explain their types with their suitable examples.

5 marks | Asked in 2067

7. What is multiple inheritance? Explain with example.

5 marks | Asked in 2072

7. What is the role of protected access specifies in inheritance ? Explain with example.

5 marks | Asked in 2074

7. Differentiate between base class and derived class with suitable examples.

5 marks | Asked in 2068

8. Differntiate between private, public and protected variable with suitable example.

5 marks | Asked in 2068

8. Briefly explain types of inheritance used in object oriented Programming.

5 marks | Asked in 2075

10. What is container class? Differentiate container class from inheritance.

5 marks | Asked in 2075( Old Course)

12. Explain the multilevel inheritance. How is it different from multiple inheritance?

5 marks | Asked in 2072

12. Write short notes on:

    a. Manipulators

    b. Protected Access Specifier

5 marks | Asked in 2078

13. Define the various ambiguity situations that may occur during the process of inheritance. How can you resolve that ambiguity situation?
5 marks | Asked in 2075( Old Course)

Unit 6: Virtual Function, Polymorphism, and miscellaneous
19 Questions

3. Explain types of polymorphism briefly. Write down roles of polymorphism. How can we achieve dynamic polymorphism briefly. Write down foles of polymorphism. How can we achieve dynamic polymorphism? Explain with example.

10 marks | Asked in 2076

4. Display polymorphism with example.

5 marks | Asked in 2071

4. "Concept of friend in against the philosophy of Object Oriented Programming". Explain.

5 marks | Asked in 2075( Old Course) |

6. What is virtual function? Explain.

5 marks | Asked in 2070

9. Why friend function is required? Discuss with example.

5 marks | Asked in Model Question

10. How late binding is different from early binding. Write a program that explains late binding using virtual function.

5 marks | Asked in Model Question

8. What is friend function? Why it is used in OOP? Explain with an example.

5 marks | Asked in 2067

8. Differentiate between virtual function and pure virtual function.

5 marks | Asked in 2074

9. Differentiate between compile time polymorphism and run time polymorphism.

5 marks | Asked in 2075( Old Course)

9. What is container class? Differentiate container class from inheritance.

5 marks | Asked in 2067

8. What is the concept of friend function? How it violates the data hiding principle? Justify with example.

5 marks | Asked in 2078

9. Differentiate container class from inheritance. Explain with suitable example.

5 marks | Asked in 2068

9. What is abstract base class? Give an example.

5 marks | Asked in 2074

9. Differentiate between function overriding and function overloading. Explain with suitable example.

5 marks | Asked in 2066

10. Explain the role of polymorphism in Object Oriented Programming.

5 marks | Asked in 2066

10. Explain the role of polymorphism in Object Oriented Programming.

5 marks | Asked in 2068

11. Explain about “this” pointer with suitable example.

5 marks | Asked in 2068

11. What is friend function? Write a program to multiply any two private numbers of two different classes using friend function.

5 marks | Asked in 2074 |

13. Explain the friend function with its syntax.

5 marks | Asked in 2070

Unit 7: Function Templates and Exception Handling
18 Questions

6. What is template? How can you differentiate a function template from a class template? Explain.

5 marks | Asked in 2075( Old Course) |

6. Write a C++ program containing a possible exception. Use a try block to throw it and a catch block to handle it properly.

5 marks | Asked in 2068

6. Why exception handling is required? Explain with suitable example.

5 marks | Asked in 2066

8. Write a C++ program containing a possible exception. Use a try block to throw it and a catch block to handle it.


5 marks | Asked in 2075( Old Course)

11. Why do we need exceptions? Explain “exceptions with arguments” with suitable program.

5 marks | Asked in Model Question

9. What is exception? Why exception handling is better to use? Explain exception handling with try..... catch by using suitable example.

5 marks | Asked in 2078

10. Explain the function templates with example.

5 marks | Asked in 2070

11. Differentiate between overloaded functions and function templates.

5 marks | Asked in 2069

11. Discuss importance of template. Write syntax of function template. 

5 marks | Asked in 2073

9. How can you define catch statement that can catch any type of exception? Illustrate the use of multiple catch statement with example.

5 marks | Asked in 2076 |

10. When class templates are useful? How can you define a class that can implement stack with integer as well as sack of strings? Illustrate with example.

5 marks | Asked in 2078

12. Discuss different keywords used in exception handling.

5 marks | Asked in 2073

10. Create a function called swaps() that interchanges the values of the two arguments sent to it (pass these arguments by reference).  Make the function into a template, so it can be used with all numerical data types (char, int, float, and so on). Write a main() program to exercise the function with several types.

5 marks | Asked in 2075 |

12. What are the main advantages of using exception handling mechanism in a program?

5 marks | Asked in 2069

12. Define try, throw and catch statement in C++ with example.

5 marks | Asked in 2074

11. Explain how exceptions are used for handling C++ error in a systematic and OOP-oriented way with the design that includes multiple exceptions.

5 marks | Asked in 2075 |

13. Differentiate between class template and function template.

5 marks | Asked in 2074

13. Explain the exceptional handling with example.

5 marks | Asked in 2072

Unit 8: File handling
12 Questions

3. Briefly explain the hierarchy of stream classes. Write a program that overloads extraction and insertion operators.

10 marks | Asked in 2075

5. Discuss input and output with C in and C out respectively.

5 marks | Asked in 2073

4. Write a member function called reverseit() that reverses a string ( an array of character). Use a for loop that swaps the first and last characters, then the second and next-to last characters and so on. The string should be passed to reverseit() as an argument.

5 marks | Asked in 2075 |

5. What is the use of get and getline functions? Explain with suitable example.

5 marks | Asked in 2078

8. Write a program in C++ to count a number of words in a line of text.

5 marks | Asked in 2066

12. What are the advantages of using the stream classes for I/O? Write a program that writes object to a file.

5 marks | Asked in Model Question

10. Explain the features of I/O system supported by C++.

5 marks | Asked in 2069

10. Which functions can be used for reading and writing object? Describe briefly. Write a program that read values of two objects of student class(assume data members are sid , sname, and level) and display the data in monitor.

5 marks | Asked in 2076

11. What is meant by stream? Write a program that reads content of file data.txt and displays the content in monitor.

5 marks | Asked in 2078

12. Write the syntax and use of get line () and write () functions.

5 marks | Asked in 2070

12. Write short notes on:

  • Cascading of IO operators
  •  Pure Virtual Function
5 marks | Asked in 2076

12. How is character I/O different from Binary I/O? Explain with examples.

5 marks | Asked in 2075