Today our task is to fill a pool with water. In doing so, we mustn't drown anyone, but we also don't want to hold back: we'll fill it to the brim! The filling method will take the dimensions of the pool. We will assume that it is a parallelepiped, i.e. it has a well-defined length, width and depth. And the method will return the required amount of water. In liters.
Fill a pool with water
- 1
Locked
Comments (24)
- Popular
- New
- Old
You must be signed in to leave a comment
Lunita
13 January, 02:47
Solved with a constant of 1000, typecasting the parameters and returning the result.
+3
acg.comured
14 June 2021, 15:54
ok
0
Glen
12 February 2021, 17:12
If you look at the example output and compare it to the example input you can tell there is a constant of 1000
+1
Java_Mooood
16 October 2020, 21:58
Google
+1
Innocent O.
28 July 2020, 14:51
Here is the trick, the dimensions are in meters and 1 meter cube = 1000 litres. :)
+5
Maryem Vickers
13 October 2020, 18:29
you clever old innocent.
0
Devonte A
21 April 2020, 20:15
Found this hint online - The formula for the volume is then equal to the area of that circle times the height of the cylinder. Dividing the volume (in cubic centimeters) of the shape by 1,000 will give you the volume in liters (L).
+1
Luke
6 March 2020, 00:46
At first I tried using a double for the variable in the getVolume method and it didn't work. Then after a little digging i found that you need a "long" variable. I didn't know about that variable type before and I'm wondering weather I missed it or if it just wasn't mentioned
0
Martin Toennishoff
17 February 2020, 17:25
There should be some hint that the dimensions are meant to be meters in the hints, too. I plain overlooked it in the description.
+2
Jason
11 September 2019, 13:31
I have the correct formula, and getVolume(int, int, int) is returning 250000 in a long. The "verify" is not working and says I am not returning the correct volume for the last step.
0
Roman
12 September 2019, 05:47
If you need help, please, describe your question/issue in the HELP section at codegym.cc/help.
+1
Balmer Mwongera
8 July 2019, 19:04
/* Comment has been deleted */
+1
Roman
9 July 2019, 05:38
Posting the solution in the comments is prohibited.
+1