This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = 4*pi;
y_correct = 4*pi/3;
assert(abs(sphere_volume(x) - y_correct) < tolerance)
|
2 | Pass |
x = 36*pi;
y_correct = 36*pi;
assert(abs(sphere_volume(x) - y_correct) < tolerance)
|
3 | Pass |
x = 6;
y_correct = sqrt(6/pi);
assert(abs(sphere_volume(x) - y_correct) < tolerance)
|
4 | Pass |
x = pi;
y_correct = pi/6;
assert(abs(sphere_volume(x) - y_correct) < tolerance)
|
5 | Pass |
x = 10*pi;
y_correct = 16.5576;
assert(abs(sphere_volume(x) - y_correct) < tolerance)
|
6 | Pass |
x = 17*pi;
y_correct = 36.7005;
assert(abs(sphere_volume(x) - y_correct) < tolerance)
|
7 | Pass |
x = 42;
y_correct = 25.5946;
assert(abs(sphere_volume(x) - y_correct) < tolerance)
|
8 | Pass |
x = 1/pi;
y_correct = 0.0169;
assert(abs(sphere_volume(x) - y_correct) < tolerance)
|
5704 Solvers
376 Solvers
208 Solvers
Fahrenheit to Celsius converter
358 Solvers
2145 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!