Lab 18
Lab 18
Lab 18
Signature: ____________________________
Objective
The objective of this lab is to observe the basic knowledge of programming in C++.
Equipment and Component
Component Value Quantity
Description
Computer Available in lab 1
Conduct of Lab
1. Students are required to perform this experiment individually.
2. In case the lab experiment is not understood, the students are advised to seek help from
the course instructor, lab engineers, assigned teaching assistants (TA) and lab
attendants.
Virtual inheritance is a mechanism in C++ used to resolve the "diamond problem," which occurs when a
class inherits from two classes that share a common base class. Virtual inheritance ensures that only one
copy of the common base class is shared among the derived classes, preventing ambiguity and redundant
data. It is achieved by using the virtual keyword during the inheritance declaration.
Lab Task
Part A [Marks: 5]