Given hole diameter a, and outermost diameter b, determine the volume y of the resulting donut.

Show
6 older comments

the cyclist
on 28 Jan 2012

I think the input are the radii, not the diameters, but I'm too lazy to check for sure.

Daniel
on 28 Jan 2012

not really, the test sequence is simply wrong.

...
on 25 Feb 2012

I spend 20mn to understand that the data are inverted, thanks :|

...
on 25 Feb 2012

and also five minus it is not diameter but radii, a is outer radii and b the radii of the hole

Bart Vandewoestyne
on 20 Apr 2012

It should be specified more clear what the input parameters mean exactly geometrically.

Peter Wittenberg
on 3 Jun 2012

What a waste! Calling a radius a diameter. I got numbers that were off by a factor of 8, which turned out to be that I had used the information that a and b were diameters, whereas Bistwas used them as radii. Please correct the problem definition.

CC
on 3 Jun 2012

If a is the hole diameter and b is the outermost diameter, how can a>b in the test cases?

Matthew Eicholtz
on 21 Jul 2012

Problem is written incorrectly.

bainhome
on 23 Aug 2014

test suite'answer is wrong if a and b is diameter instead of radius.

1 Comment

eggart
on 29 Feb 2016

I wonder whether it it adequate to test correctness of double answers by equality. To do so discounts rounding errors and the fact that IEEE 754 does not guarantee the laws of arithmetic.

1 Comment

William
on 24 Jan 2016

So, when you say "diameter" you mean "radius"? And when you say "outer" you mean "inner"?

1 Comment

CC
on 3 Jun 2012

If a is the hole diameter and b is the outermost diameter, how can a>b in the test cases?

**Tags**

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today
1 player likes this problem

1 player likes this problem