Question
In Java: Write code to instantiate object scan from Scanner class. Ask user to provide input radius as a positive integer. Store user input in
In Java: Write code to instantiate object scan from Scanner class. Ask user to provide input radius as a positive integer. Store user input in variable radius. Write code to calculate and print volume and area of the sphere defined with that radius. Display result by reiterating radius entered by user, and display surface area and volume of the sphere. Use the formulas: volume=(4 radius^3 )/3 area=4 radius^2 After that have your program generate an object generator from class Random. Use it to invoke method nextInt( int num) to generate random value in the range from 1 to 10000. Next, use that random value to overwrite previous value of the radius. Finally, your program should display this randomly generated radius and corresponding surface area and volume of the sphere.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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