Error
|
|
---|---|
@Ibrahim Nash | 5761 |
@blackshadows | 5715 |
@akhayrutdinov | 5111 |
@mb1973 | 4989 |
@Quandray | 4944 |
@saiujwal13083 | 4506 |
@sanjay05 | 3762 |
@marius_valentin_dragoi | 3516 |
@sushant_a | 3459 |
@verma_ji | 3341 |
@KshamaGupta | 3318 |
Complete Leaderboard | |
|
|
@aroranayan999 | 1115 |
@bt8816103042 | 739 |
@thealchemist627 | 456 |
@akashkale117 | 453 |
@shivanandp12345678910 | 453 |
@dalwainazism125 | 453 |
@codeantik | 448 |
@SherlockHolmes3 | 447 |
@SHOAIBVIJAPURE | 430 |
@shalinibhataniya1097 | 408 |
@ShamaKhan1 | 392 |
Complete Leaderboard |
Create two classes:
Cuboid
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.
CuboidVol
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 ).
Input:
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
Output:
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.
Constraints:
0 <= (length, width, height) <= 100
Example:
Sample input:
1
12 10 2
Sample output:
12 10 2
240
Explanation:
As here length = 12, width = 10 and height = 2
Volume of the cuboid is = ( length * width * height )
= 12 * 10 * 2
= 240
We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?
Yes