Find the value for area of the circle if diameter is given
are you sure?? O_o
Radius or diameter ?
Test suite does not correspond to question.
yes... I also think test suite is wrong...
I think the test suite is definitely basing it on the radius as the input and not the diameter
The problem means "radius" although it says diameter.
Diameter = 2 * radius
The test suite is misleading, instead of 'diameter', it is supposed to be 'radius'. The area can be calculated this way easily, too: A=(d^2)*pi/4, but it would be another task.
For this problem, you have taken x as diameter, but answer is correct when you take x as radius. So, please improve your correct answer code.
i think, the question should be updated.It should be written radius instead of diameter....
the area of a circle is defined by:
A = (pi)*(r^2)
--> for d = 2 like in your test suite that means:
r = d/2 --> r=1
--> r^2 = 1
--> multplied by pi = 1*pi
so A(d=2) = A(d/2) = A(r) = r^2 * pi = 1^2 * pi = 1 * pi = pi
not 4*pi like your solution suggests.
Your solution would be correct for R=2 - not D=2 - you should correct this. Ether you change the description that the diameter is given (should be radius to be correct) or you change the Test suite inm order to give correct results.
The test suite is incorrect. It is either the surface area of a sphere given the diameter or the area of a circle given a radius.
Please correct the problem. According to the test case it's the radius that is given, not the diameter...
This user (ALBERT ALEXANDER STONIER) appears to have gamed the system, with fraudulent "likes" of this unremarkable solution submitted by 'sock-puppet' accounts. —DIV
I think , test suite is wrong according to the question statement.
Did you mean "the area of a sphere?"
More test cases need to be added.
Convert a vector into a number
07 - Common functions and indexing 3
Max of a Vector
Finding fourier transform of a given vector
Maximum value in a matrix
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office