Question: X319: sphereVolume Given an integer representing the radius of a sphere, compute and return the sphere's volume based on the following formula: Volume = 4/3

X319: sphereVolume Given an integer representing the radius of a sphere, compute and return the sphere's volume based on the following formula: Volume = 4/3 x Pi x radius Examples: sphereVolume (5) -> 523.598775598 sphereVolume (12) -> 7238.229473871 public double sphereVolume(int radius) double v; v=((4/3)*(Math.PI))*radius*radius *radius; return v; public static void main(String [] args) { int radius; Scanner s=new Scanner(System.in); line 9: error: cannot find svmbol: class Scanner 1 public double sphereVolume (int radius) double v; v=((4/3)*(Math.PI))*radius*radius*radius; return v; 600 vau WN 7 public static void main(String [] args) { int radius; Scanner s=new Scanner(System.in); line 9: error: cannot find symbol: class Scanner radius=s.nextInt(); double volume=sphereVolume (radius); System.out.println(volume)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
