Fill a pool with water

  • 1
  • Locked
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.
You can't complete this task, because you're not signed in.
Comments (22)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Glen Level 7, Yuma, United States
12 February, 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
Java_Mooood Level 3, San Antonio, United States
16 October 2020, 21:58
Innocent O. Level 5, Munich, Germany
28 July 2020, 14:51
Here is the trick, the dimensions are in meters and 1 meter cube = 1000 litres. :)
Maryem Vickers Level 7, HT..., United Kingdom
13 October 2020, 18:29
you clever old innocent.
Devonte A Level 17, Rubery, United Kingdom
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).
Luke Level 5, Seattle, United States
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
Martin Toennishoff Level 6, Karlsruhe, Germany
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.
Jason Level 16, United States
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.
Roman Level 41
12 September 2019, 05:47
If you need help, please, describe your question/issue in the HELP section at
Balmer Mwongera Level 3, Nairobi, Kenya
8 July 2019, 19:04
/* Comment has been deleted */
Roman Level 41
9 July 2019, 05:38
Posting the solution in the comments is prohibited.
carlos oliveira Level 8, Seattle, United States
28 February 2019, 18:32
1 meter cubic = 1000 liters
Adnan Sami Level 3, Karachi, Pakistan
15 April 2019, 08:06
Done thanks
Md Sait Level 4, Hyderabad, India
27 October 2018, 06:22
so to learn code we need to have science as background,,,,!