Professional Documents
Culture Documents
Assignment No - II - OOPS - B.Tech - 2nd Year
Assignment No - II - OOPS - B.Tech - 2nd Year
*********************************************************************************************
Assignment No: 02
Quest 01: 2
Quest 02: 3
(Write the source code with output and explain the methodology for the following scenarios)
Create two classes named as “Mammals” and "Marine Animals”. Design a new class
called "BlueWhale," which is an inherited version of the two classes mentioned before. Create a
function that prints the following in each of these classes:
"I am a mammal"
"I am a marine animal"
"I belong to both categories: mammals and marine animals".
Now, make an object for every class mentioned above, and attempt calling
i. Function of “Mammals” by the object of “Mammal”
ii. Function of “MarineAnimal” by the object of “MarineAnimal”
iii. Function of “BlueWhale” by the object of “BlueWhale”
iv. Function of each of its parent by the object of “BlueWhale”.