OOP & Inheritance
1 question · Fundamental Engineering
From the answer group below, select the correct answer to be inserted into blank in the description.
Class Rectangle represents a two-dimensional figure, and class Cuboid represents a three-dimensional figure. The class Cuboid is a subclass of the class Rectangle. Figures 1 and 2 explain the classes Rectangle and Cuboid, respectively.
Figure 1 Class Rectangle
Figure 2 Class Cuboid
When the program is executed, it is expected to produce the output “blank”.
Rectangle: f1 ← Rectangle(5, 2)
Cuboid: f2 ← Cuboid(9, 4, 7)
f1.enlarge(f2)
f1.output()
Answer group