Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

=+6. Whether they'd talk to others about the ad.

Answered: 1 week ago