Create two classes:
The Cuboid class should have three data fields- length, width and height of int types. The class should have display() method, to print the length, width and height of the cuboid separated by space.
The CuboidVol class is derived from Cuboid class, i.e., it is the sub-class of Cuboid class. The class should have read_input() method, to read the values of length, width and height of the Cuboid. The CuboidVol class should also overload the display() method to print the volume of the Cuboid ( length * width * height ).
The first line contains the number of test cases and one and only line of each test case contains 3 space separated integer denoting length, width, and height of the Cuboid
The output should consist of exactly two lines:
In the first line, print the length, width, and height of the cuboid separated by space.
In the second line, print the volume of the cuboid.
0 <= (length, width, height) <= 100
12 10 2
12 10 2
As here length = 12, width = 10 and height = 2
Volume of the cuboid is = ( length * width * height )
= 12 * 10 * 2
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?Yes