Page 1 of 1

CHALLENGE 2.7.1: Sphere volume. ACTIVITY Given sphereRadius, compute the volume of a sphere and assign sphereVolume with

Posted: Fri Jul 01, 2022 5:42 am
by answerhappygod
Challenge 2 7 1 Sphere Volume Activity Given Sphereradius Compute The Volume Of A Sphere And Assign Spherevolume With 1
Challenge 2 7 1 Sphere Volume Activity Given Sphereradius Compute The Volume Of A Sphere And Assign Spherevolume With 1 (55.32 KiB) Viewed 29 times
I need help with this.
CHALLENGE 2.7.1: Sphere volume. ACTIVITY Given sphereRadius, compute the volume of a sphere and assign sphereVolume with the result. Use (4.0/3.0) to perform floating- point division, instead of (4/3) which performs integer division. Volume of sphere = (4.0 / 3.0) π r³ (Hint: r³ can be computed using *) (Notes) 413706.2298628.qx3zqy7 1 #include <iostream> 2 #include <iomanip> 3 #include <<math> 4 5 using namespace std; 6 7 int main() { 8 9 10 11 12 13 14 15 16 17 Run | double sphereVolume; double sphereRadius; cin >> sphereRadius; cout << fixed << setprecision (2) << sphereVolume << endl; return 0; Common student error Your code did not use M_PI, a preferred solution uses M_PI. 1 test passed All tests passed