0% found this document useful (0 votes)
7 views7 pages

Question Bank Oop

The document outlines a comprehensive curriculum on Object-Oriented Programming (OOP) in C++, covering key concepts such as classes, inheritance, polymorphism, function overloading, and constructors. It includes a structured question bank categorized into short, long, and problem-solving questions aimed at assessing understanding and application of OOP principles. The curriculum is approved by AICTE and affiliated with various universities in Uttarakhand, India.

Uploaded by

n7723474
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)
7 views7 pages

Question Bank Oop

The document outlines a comprehensive curriculum on Object-Oriented Programming (OOP) in C++, covering key concepts such as classes, inheritance, polymorphism, function overloading, and constructors. It includes a structured question bank categorized into short, long, and problem-solving questions aimed at assessing understanding and application of OOP principles. The curriculum is approved by AICTE and affiliated with various universities in Uttarakhand, India.

Uploaded by

n7723474
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/ 7

Approved by AICTE, Ministry of HRD, Govt.

of India ISO 9001:2015, ISO 14001:2015, ISO 50001:2018


Affiliated: VMSB Uttarakhand Technical University  Sri Dev Suman Uttarakhand University  Uttarakhand Board of Technical Education

13.Question Bank (Module-Wise)


UNIT-I
OBJECT ORIENTED PROGRAMMING
Classes and Objects, Methods and Messages, Abstraction and Encapsulation, Inheritance,
Abstract Classes, Polymorphism. Introduction to C++: Classes and Objects, Structures and
Classes, Unions and Classes, Friend Functions, Friend Classes, Inline Functions, Static Class
Members, Scope Resolution Operator, Nested Classes, Local Classes, Passing Objects to Functions,
Returning objects, object assignment. Arrays, Pointers, References, and the Dynamic Allocation
Operators: Arrays of Objects, Pointers to Objects, Type Checking, this Pointer, Pointers to
Derived Types, Pointers to Class Members, References, Dynamic Allocation Operators.

Part - A (Short Answer Questions)


S No QUESTIONS Blooms Course Outcomes
Taxonomy Level

1. What is a class in C++? Remember CO1


2. Define abstraction in object-oriented programming. Remember CO1
3. Explain the purpose of this pointer in C++. Remember CO1
4. What is the scope resolution operator used for in C++? Remember CO1
5. Describe the concept of polymorphism in object-oriented Remember CO1
programming.
6. How do you define methods within a class in C++? Understand CO1
7. Differentiate between structures and classes in C++. Understand CO1
8. What are friend functions and how are they used in C++? Understand CO1
9. Explain the concept of inheritance with an example. Understand CO1
10. ow does dynamic memory allocation work in C++? Understand CO1
Part - B (Long Answer Questions)
1. Explain the concept of encapsulation in object-oriented Remember CO1
programming. Provide an example in C++.
2. Describe the process of passing objects to functions in Remember CO1
C++. Include the necessary syntax and potential
advantages.
3. Discuss the purpose and usage of static class members in Remember CO1
C++ classes. Provide an example to illustrate your
explanation.
4. What is the difference between arrays and arrays of Remember CO1
objects in C++? Provide examples to illustrate.
5. Explain the significance of the friend keyword in C++ Remember CO1
classes. How does it facilitate access to private members?
6. Describe the key characteristics of classes and objects in Remember CO1
C++. Provide examples to illustrate your explanation.
7. Explain the concept of abstraction in object-oriented Remember CO1
programming. How does it contribute to code organization
and simplification?
8. Discuss the role of the this pointer in C++. How is it used Remember CO1
to differentiate between class members and function
parameters?
9. Compare and contrast pointers and references in C++. Understand CO1
Discuss their similarities, differences, and use cases.
10. Discuss the concept of inheritance and its various types in Understand CO1
C++. Provide examples to illustrate single and multiple
inheritance.
Approved by AICTE, Ministry of HRD, Govt. of India ISO 9001:2015, ISO 14001:2015, ISO 50001:2018
Affiliated: VMSB Uttarakhand Technical University  Sri Dev Suman Uttarakhand University  Uttarakhand Board of Technical Education

11 Explain the concept of polymorphism in C++ with suitable Understand CO1


examples. Discuss how it allows for flexibility and
extensibility in code.
12 Describe the purpose and usage of inline functions in C++. Understand CO1
How do they differ from regular functions? Provide
examples.
13 Define dynamic allocation operators new and delete in Understand CO1
C++. Discuss their role in managing memory dynamically.
Provide examples demonstrating their usage.
14 Compare and contrast structures and classes in C++. Understand CO1
Discuss their similarities, differences, and appropriate use
cases.
15 Explain the concept of unions in C++ and how they differ Understand CO1
from classes. Provide examples to demonstrate their usage.
16 Discuss the concept of scope resolution operator (::) in Understand CO1
C++. How is it used to access members within nested
classes or namespaces?
Part - C (Problem Solving and Critical Thinking Questions)
1. Implement a C++ program demonstrating the use of Apply CO1, CO2
abstract classes and pure virtual functions to represent
geometric shapes.
2. Design a C++ program showcasing the implementation of Apply CO1, CO2
object assignment operators (= and ==) for a custom class.
Discuss the considerations and challenges involved.
3. Develop a C++ program implementing a banking system Apply CO1, CO2
using classes and objects. Include features such as account
creation, deposit, withdrawal, and balance inquiry. Use
encapsulation to ensure data integrity
4. Develop a C++ program that demonstrates the use of Apply CO1, CO2
friend functions and friend classes to access private
members of a class. Provide rationale for their usage.
5. Implement a C++ program that utilizes static class Apply CO1, CO2
members to maintain a count of objects instantiated from a
particular class. Illustrate how this count is updated and
accessed.
6. Explain the use of polymorphism in a C++. Discuss its Apply CO1, CO2
impact on code readability, maintainability, and
extensibility, considering factors such as inheritance
hierarchies and code reuse.
UNIT-II
Function Overloading and Constructors
Function Overloading, Constructors, parameterized constructors, Copy Constructors, Overloading
Constructors, Finding the Address of an Overloaded Function, Default Function Arguments, Function
Overloading and Ambiguity. Operator overloading: Creating member Operator Function, Operator
Overloading Using Friend Function, Overloading New and Delete, Overloading Special Operators,
Overloading Comma Operator.
Part - A (Short Answer Questions)
1. What is function overloading in C++? Remember CO2
2. Explain the concept of a constructor in C++. Remember CO2
3. How do you define a parameterized constructor? Remember CO2
4. What is a copy constructor, and when is it invoked? Remember CO2
5. How can you overload constructors in C++? Remember CO2
6. What are default function arguments in C++? Remember CO2
7. Define the term "ambiguity" in the context of function Remember CO2
overloading.
8. Explain the purpose of operator overloading in C++. Remember CO2
Approved by AICTE, Ministry of HRD, Govt. of India ISO 9001:2015, ISO 14001:2015, ISO 50001:2018
Affiliated: VMSB Uttarakhand Technical University  Sri Dev Suman Uttarakhand University  Uttarakhand Board of Technical Education

9. Differentiate between default constructors and Understand CO2


parameterized constructors.
10. Explain why copy constructors accept references rather Understand CO2
than values.
11. How does function overloading contribute to code Understand CO2
readability and maintainability?
Part – B (Long Answer Questions)
1. Explain the concept of function overloading in C++. Understand CO1,CO2
Provide examples demonstrating how functions can be
overloaded based on different parameter types and
numbers.
2. Describe the purpose and significance of constructors in Understand CO1,CO2
C++. Discuss the difference between default constructors
and parameterized constructors with suitable examples.
3. Discuss the various ways to define a copy constructor in Understand CO1,CO2
C++. Provide examples illustrating the use of shallow and
deep copy constructors.
4. Discuss the role of default function arguments in C++ and Understand CO1,CO2
how they contribute to function overloading. Provide
examples demonstrating their usage.
5. Explain the concept of dynamic initialization of objects in Understand CO1,CO2
C++ constructors. How can constructors be used to
initialize data members based on runtime values?
6. Describe the process of resolving function overloading Understand CO1,CO2
ambiguity in C++. Explain how the compiler determines
the most appropriate function to call.
7. Design a C++ program that employs constructor Apply CO1,CO2
overloading to create objects representing different types
of vehicles (e.g., car, motorcycle, truck). Include member
functions to display vehicle details.
Part – C (Problem Solving and Critical Thinking)
1. Design a C++ program that employs constructor Apply CO1, CO2
overloading to create objects representing different types
of vehicles (e.g., car, motorcycle, truck). Include member
functions to display vehicle details.
2. Discuss the effectiveness of using default arguments in Apply CO1,CO2
C++ functions. Discuss situations where default arguments
can simplify function calls and where they may lead to
ambiguity or unexpected behavior.
3. Develop a C++ program that utilizes constructor Apply CO1, CO2
overloading to create objects representing different types
of employees (e.g., full-time, part-time, contractor).
Implement methods for calculating pay based on
employment status.
4. Develop a C++ program that demonstrates the use of Apply CO1, CO2
function overloading to handle different data types (e.g.,
integers, floats, strings) for mathematical operations (e.g.,
addition, subtraction).
5. Design a C++ program that employs constructor Apply CO1, CO2
overloading to create objects representing different shapes
(e.g., circle, rectangle, triangle). Implement methods to
calculate area and perimeter for each shape.
UNIT-III
Inheritance and Polymorphism:
Inheritance: Base-Class Access Control, Inheritance and Protected Members, Inheriting Muitiple Base Classes,
Constructors, Destructors and Inheritance, Granting Access, Virtual Base Classes. Polymorphism: Virtual
Approved by AICTE, Ministry of HRD, Govt. of India ISO 9001:2015, ISO 14001:2015, ISO 50001:2018
Affiliated: VMSB Uttarakhand Technical University  Sri Dev Suman Uttarakhand University  Uttarakhand Board of Technical Education

Functions, Virtual Attribute and Inheritance, Virtual Functions and Hierarchy, Pure Virtual Functions, Early
vs. Late Binding, Run-Time Type ID and Casting Operators: RTTI, Casting Operators, Dynamic Cast.
Part – A (Short Answer Questions)
1. What is the purpose of access control in C++ inheritance? Remember CO1, CO2
2. Explain the difference between public, private, and Remember CO1, CO2
protected inheritance.
3.. What is the significance of protected inheritance? Remember CO1, CO2
4. Define multiple inheritance in C++. Remember CO1, CO2
5. How are protected members of a base class accessed in Remember CO1, CO2
derived classes?
6. Discuss the advantages and drawbacks of multiple Remember CO1, CO2
inheritance.
7. How are constructors and destructors inherited in C++? Remember CO1, CO2

8. In what order are constructors and destructors called in a Remember CO1, CO2
derived class?
9. What are the different ways to grant access to base class Understand CO1, CO2
members in derived classes?
10. Explain the use of friend functions in accessing base class Understand CO1, CO2
members.
11. What is a virtual base class in C++? Understand CO1, CO2
12. How does a virtual base class address the diamond Understand CO1, CO2
problem in multiple inheritance?
13. Define virtual functions in C++. Understand CO1, CO2
14. Explain the significance of virtual functions in achieving Understand CO1, CO2
polymorphism.
15. What is a pure virtual function in C++? Understand CO1, CO2
16. What is Run-Time Type Identification (RTTI) in C++? Understand CO1, CO2
Part – B (Long Answer Questions)
1. Explain the concept of access control in inheritance. Remember CO1, CO2
Provide examples demonstrating the use of public, private,
and protected inheritance in C++.
2. Discuss the implications of changing the access specifier Remember CO1, CO2
when inheriting a base class privately or publicly in C++.
How does it affect member accessibility in derived
classes?
3. Describe the role of protected members in C++ Understand CO1, CO2
inheritance. Provide examples to illustrate how protected
members are accessible in derived classes but not outside
the inheritance hierarchy.
4. Discuss scenarios where using protected inheritance is Remember CO1, CO2
preferred over public or private inheritance. Provide real-
world examples to support your explanation
5. Discuss the behavior of constructors and destructors in Remember CO1, CO2
C++ inheritance. Explain how constructors and destructors
are invoked in derived classes.
6. Explain the importance of invoking base class constructors Understand CO1, CO2
explicitly in derived class constructors. Provide examples
to illustrate the constructor chaining process.
7. Discuss various methods for granting access to base class Understand CO1, CO2
members from derived classes in C++. Compare and
contrast using friend functions, protected members, and
inheritance for accessing base class members.
8. Explain the concept of virtual base classes in C++. Discuss Remember CO1, CO2
how virtual base classes address the diamond problem in
multiple inheritance.
9. Define virtual functions in C++. Discuss how virtual Understand CO1, CO2
Approved by AICTE, Ministry of HRD, Govt. of India ISO 9001:2015, ISO 14001:2015, ISO 50001:2018
Affiliated: VMSB Uttarakhand Technical University  Sri Dev Suman Uttarakhand University  Uttarakhand Board of Technical Education

functions enable runtime polymorphism and dynamic


method binding.
10. Compare and contrast using the virtual attribute with Understand CO1, CO2
defining virtual functions. Discuss scenarios where each
approach is preferred.
11. Explain how pure virtual functions can be used to enforce Understand CO1, CO2
a common interface across derived classes. Provide
examples to illustrate the implementation of pure virtual
functions.
12. Explain the purpose and usage of Run-Time Type Understand CO1, CO2
Identification (RTTI) in C++. Discuss how RTTI can be
used to determine the dynamic type of objects during
runtime.
13. Discuss the differences between various casting operators Understand CO1, CO2
in C++, such as static_cast, dynamic_cast, and
reinterpret_cast. Provide examples to illustrate their usage
and scenarios where each operator is appropriate.
Part – C (Problem Solving and Critical Thinking)
1. Design a C++ program that models a company's employee Apply CO1, CO2
hierarchy using inheritance. Include classes for different
types of employees (e.g., full-time, part-time, manager)
and demonstrate how inheritance simplifies code
organization and maintenance.
2. Develop a C++ program that implements a graphical shape Apply CO1, CO2
library utilizing polymorphism. Design classes for various
shapes (e.g., circle, rectangle, triangle) with virtual
functions for calculating area and perimeter.
3. Discuss the effectiveness of using access specifiers Apply CO1, CO2
(public, private, protected) in C++ inheritance. Discuss
how access control influences code readability,
encapsulation, and modifiability.
4. Discuss the use of pure virtual functions in defining Apply CO1, CO2
abstract base classes in C++. Discuss potential challenges
and alternative approaches for achieving interface
abstraction and polymorphism.
5. Examine the use of virtual base classes in resolving the Apply CO1, CO2
diamond problem in C++ multiple inheritance. Discuss
potential alternatives and their implications for code
maintainability and performance.
. UNIT-IV
Templates and Exception Handling
Templates: Generic Functions, Applying Generic Functions, Generic Classes, The type name and export
Keywords, Power of Templates, Exception Handling: Fundamentals, Handling Derived Class Exceptions,
Exception Handling Options, Understanding terminate() and unexpected(), uncaught_exception ()
Function, exception and bad_exception Classes, Applying Exception Handling.
Part - A (Short Answer Questions)
1. What are generic functions and how are they useful in Understand CO1, CO3, CO4
C++?
2. How do you apply generic functions in C++? Provide an Remember CO1, CO3, CO4
example.
3. Explain the concept of generic classes in C++. How do Understand CO1, CO3, CO4
they differ from generic functions?
4. When should you use the typename and export Remember CO1, CO3, CO4
keywords in template programming?
5. Discuss the power of templates in C++ and provide Understand CO1, CO3, CO4
examples of their application.
6. What are the fundamentals of exception handling in C++? Understand CO1, CO3, CO4
7. How do you handle exceptions thrown by derived classes Understand CO1, CO3, CO4
Approved by AICTE, Ministry of HRD, Govt. of India ISO 9001:2015, ISO 14001:2015, ISO 50001:2018
Affiliated: VMSB Uttarakhand Technical University  Sri Dev Suman Uttarakhand University  Uttarakhand Board of Technical Education

in C++?
8. What are the available options for exception handling in Understand CO1, CO3, CO4
C++?
9. Explain the purpose and behavior of std::terminate() and Remember CO1, CO3, CO4
std::unexpected() in C++ exception handling.
10. What is the role of the std::uncaught_exception() Understand CO1, CO3, CO4
function in C++?
11. Differentiate between the std::exception and Understand CO1, CO3, CO4
std::bad_exception classes in C++.
12. How do you apply exception handling in C++? Provide an Remember CO1, CO3, CO4
example illustrating its usage.
Part - B (Long Answer Questions)
1. Explain the concept of generic functions in C++ using Remember CO1, CO3, CO4
templates. Provide examples demonstrating the creation
and use of generic functions.
2. Discuss the versatility and power of templates in C++. Remember CO1, CO3, CO4
Explain how templates enable the creation of generic
algorithms and data structures.
3. Describe the process of applying generic functions in real- Understand CO1, CO3, CO4
world scenarios. Provide examples where the use of
generic functions simplifies code and improves code reuse.
4. Define generic classes in C++ using templates. Explain the Understand CO1, CO3, CO4
syntax for declaring and implementing generic classes.
5. Discuss the significance of the typename and export Understand CO1, CO3, CO4
keywords in template declarations. Explain when and how
they are used in template programming.
6. Identify the advantages and limitations of using templates Understand CO1, CO3, CO4
in C++ programming. Discuss scenarios where templates
are particularly useful.
7. Describe the fundamentals of exception handling in C++. Understand CO1, CO3, CO4
Explain the purpose of exception handling and how it
differs from traditional error-handling mechanisms.
8. Explain the purpose and behavior of the terminate() and Understand CO1, CO3, CO4
unexpected() functions in C++ exception handling.
Discuss their role in handling uncaught exceptions and
unexpected program termination.
9. Define the std::exception and std::bad_exception classes in Understand CO1, CO3, CO4
C++. Discuss their hierarchy and the types of exceptions
they represent.
Part – C (Problem Solving and Critical Thinking)
1. Design a C++ template function that sorts an array of any Apply CO1, CO3, CO4
data type in ascending order using the quicksort algorithm.
Handle exceptions for invalid input array or unsupported
data types.
2. Develop a C++ template class that represents a generic Apply CO1, CO3, CO4
stack data structure. Implement methods for push, pop,
and top operations, ensuring exception safety and proper
error handling.
3. Create a C++ program that utilizes templates to implement Apply CO1, CO3, CO4
a generic calculator capable of performing arithmetic
operations on operands of any data type. Handle
exceptions for division by zero and invalid input.

UNIT-V
I/O System Basics:
Approved by AICTE, Ministry of HRD, Govt. of India ISO 9001:2015, ISO 14001:2015, ISO 50001:2018
Affiliated: VMSB Uttarakhand Technical University  Sri Dev Suman Uttarakhand University  Uttarakhand Board of Technical Education

Streams and Formatted 1/O. File I/O: File Classes, File Operations. Namespaces: Namespaces, std
Namespace. Standard Template Library: Overview, Container Classes, General Theory of Operation, Lists,
string Class, Final Thoughts on STL.
Part - A (Short Answer Questions)
1. What are streams in C++ I/O system? Understand CO1, CO4
2. Explain the difference between formatted and unformatted Understand CO1, CO4
I/O.
3. How do you perform formatted output in C++ using Understand CO1, CO4
streams?
4. What are file classes in C++? Understand CO1, CO4
5. List some common file operations in C++. Understand CO1, CO4
6. How do you open a file for reading and writing in C++? Understand CO1, CO4
7. Define namespaces in C++. Understand CO1, CO4
8. Explain the significance of the std namespace in C++. Understand CO1, CO4
9. Provide an overview of the Standard Template Library Understand CO1, CO4
(STL).
10. Name three container classes provided by the STL. Understand CO1, CO4
11. How is a list different from an array in the context of the Understand CO1, CO4
STL?
Part - B (Long Answer Questions)
1. Define the concept of a C++ namespace. Provide an Understand CO1, CO4
example of how namespaces help avoid naming conflicts
in C++ programs.
2. Explain the purpose of the ifstream and ofstream classes in Understand CO1, CO4
C++ file I/O. Give examples of how these classes are used
to read from and write to files.
3. Describe the key features of a doubly linked list data Understand CO1, CO4
structure. Discuss its advantages and disadvantages
compared to other types of lists.
4. Discuss the significance of streams in C++ programming. Understand CO1, CO4
How do streams facilitate input and output operations in
C++? Provide examples to illustrate your points.
5. Explain the difference between pass-by-value and pass-by- Understand CO1, CO4
reference in C++ function arguments. Discuss the
implications of each method and when you might choose
one over the other.
6. Describe the purpose of the std::string class in C++. How Understand CO1, CO4
does it differ from C-style strings? Provide examples to
demonstrate its usage and advantages.
Part – C (Problem Solving and Critical Thinking)
1. Write a C++ program to create a new text file and write Apply CO1, CO4, CO5
some text into it.
2. Write a C++ program to count the number of lines in a text Apply CO1, CO4, CO5
file.
3. Write a C++ program to append new data to an existing Apply CO1, CO4, CO5
text file.
4. Write a C++ program to search for a specific string in a Apply CO1, CO4, CO5
text file and display its line number(s).

HOD, CSE

You might also like