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(19)
  • Popular
  • New
  • Old
You must be signed in to leave a comment
Innocent O.Level 3 , Munich
28 July, 14:51
Here is the trick, the dimensions are in meters and 1 meter cube = 1000 litres. :)
Devonte ALevel 17 , Rubery
21 April, 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).
LukeLevel 5 , Seattle
6 March, 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 ToennishoffLevel 6 , Karlsruhe
17 February, 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.
JasonLevel 16
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.
RomanLevel 41
12 September 2019, 05:47
If you need help, please, describe your question/issue in the HELP section at codegym.cc/help.
Balmer MwongeraLevel 3 , Nairobi
8 July 2019, 19:04
/* Comment has been deleted */
RomanLevel 41
9 July 2019, 05:38
Posting the solution in the comments is prohibited.
carlos oliveiraLevel 8 , Seattle
28 February 2019, 18:32
1 meter cubic = 1000 liters
Adnan SamiLevel 3 , Karachi
15 April 2019, 08:06
Done thanks
Md SaitLevel 4 , Hyderabad
27 October 2018, 06:22
so to learn code we need to have science as background,,,,!
William T HilbertLevel 3 , Overland Park
19 October 2018, 02:33
The task involves converting cubic meters into liters. Google how many liters in 1 cubic meter. Then you can figure out the solution. The solution can be accomplished with 1 line of code.
Vartaman IngoleLevel 6 , Wardha
9 November 2018, 09:43
just multiply by 1000 Sir Hilbert.
SergeyLevel 7 , Yaroslavl'
16 October 2018, 21:56
There is a mistake in "Example output". If you multiply 25, 5 and 2 than you get 250, but in "Example output" you can see "250000" and output of your code is compared with this value. So if you want to pass this exercise write in getVolume such string: ...
RomanLevel 41
17 October 2018, 06:13
There is no mistake there. Linear dimensions (a b c) given in meters, but the method should return the number of liters of water.