Assignment - 4
II Year III-Semester (AIDS)
Subject: Object-Oriented Programming (OOPs)
Submission Date: 5th December 2024
Instructions:
- Answer each question in 200 to 400 words.
- For the program question, include code, comments, and output explanation.
1. Explain the concept of constant data members and constant member functions in
C++. Provide examples and discuss their significance in object-oriented
programming.
2. Define static data members and static member functions in C++. How are they different
from non-static members, and how are they used in OOP to achieve certain functionality?
Provide an example.
3. What is polymorphism in the context of object-oriented programming? Describe the types
of polymorphism with examples, and explain why polymorphism is an essential feature in
OOP.
4. Discuss the concept of operator overloading in C++. How does operator overloading
contribute to code readability and reusability? Provide an example of how to overload an
operator in C++.
5. What is dynamic binding, and how is it related to virtual functions in C++? Explain with an
example, and describe why virtual functions are important for achieving runtime
polymorphism.