Question: CHALLENGE ACTIVITY 1.9.1: Sphere volume. Given sphereRadius, compute the volume of a sphere and assign sphere Volume with the result. Use (4.0/3.0) to perform floating-

CHALLENGE ACTIVITY 1.9.1: Sphere volume. Given sphereRadius, compute the volume of a sphere and assign sphere Volume 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) nr3 (Hint: r3 can be computed using *) (Notes) 1 test passed 283902. 1926836.qx3zqy7 1 import java.util.Scanner; 2 3 public class SphereVolumeCalculator { 4 public static void main(String[] args) { 5 Scanner scnr new Scanner(System.in); 6 double sphereVolume; double sphereRadius; 8 sphereRadius = scnr.nextDouble(); 10 11 System.out.printf("%.2f ", sphereVolume); 12 } 13 } All tests passed 9 Run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
