Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started