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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 28 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply