0% found this document useful (0 votes)
0 views3 pages

Question Bank

The document is a question bank for a mid-semester exam covering various programming paradigms, including functional, logic, and object-oriented programming. It includes questions on key concepts such as classes, objects, encapsulation, constructors, destructors, and polymorphism, along with practical programming tasks in C++. The questions aim to assess understanding and application of programming principles and techniques.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views3 pages

Question Bank

The document is a question bank for a mid-semester exam covering various programming paradigms, including functional, logic, and object-oriented programming. It includes questions on key concepts such as classes, objects, encapsulation, constructors, destructors, and polymorphism, along with practical programming tasks in C++. The questions aim to assess understanding and application of programming principles and techniques.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

MID SEM Question Bank

1. Differentiate between functional and logic programming with examples.


2. Explain the key characteristics of functional programming. Give an
example.
3. What is concurrent programming? How is it different from parallel
programming?
4. Describe the logic programming paradigm with an example.
5. Describe with example object oriented programming.

6. Define class and object in object-oriented programming. How are they


related?

7. Illustrate the difference between a class and an object with a real-world


example.

8. List and explain any four data types commonly supported in object-
oriented languages.

9. What is an Abstract Data Type (ADT)? How does it differ from a data
structure?

[Link] Stack as an ADT. List its basic operations and use any one real-
world application.

[Link] private, public, and protected access specifiers in object-


oriented programming.

[Link] a class Car with data members brand and speed. Include methods
to accelerate and display current speed. Create an object and demonstrate
method calls.

[Link] a C++ program to create a class Book with attributes like title,
author, and price. Include a constructor and a method to display book
details.

[Link] a class Calculator with methods for add, subtract, multiply, and
divide. Demonstrate these with user input.
[Link] a C++ class Employee with private salary, public name, and
protected employee ID. Write methods to set and get salary and display
details.

[Link] does encapsulation help in data hiding and security in OOP?


Illustrate with a suitable code snippet.

[Link] and explain the different types of constructors.

18. What is a destructor in C++? When is it invoked? Give an example.

19. Differentiate between a constructor and a destructor in object-oriented


programming.

[Link] is polymorphism in OOP? Explain its significance.

[Link] between compile-time and runtime polymorphism with


examples.

[Link] is method overloading? How is it achieved in Java or C++?

[Link] method overriding with a suitable program example.

[Link] a program to create a class Employee with private data members


name and salary. Provide public methods to set and get the values.
Demonstrate encapsulation.

25. Create a class BankAccount that encapsulates account number and


balance. Provide methods to deposit and withdraw money.

[Link] a program to define a class Rectangle with length and breadth. Use
a default constructor to initialize the values to 1. Include a method to
calculate area.

[Link] a program with a class Student that uses a parameterized


constructor to initialize name and roll number. Display the values using a
method.

[Link] a class Book with a copy constructor. Create one object and copy
its data into another object using the copy constructor.
[Link] a program to overload a function add() that adds two integers, two
floats, and three integers.
[Link] a program to create a base class Animal with a method sound().
Derive a class Dog and override the sound() method. Use dynamic
method dispatch to call the method.
[Link] a C++ program with a base class Shape and derived classes Circle
and Square. Override a method area() in both derived classes.

You might also like