Question: Program 2: Sphere.java . . Required: Header comments Inline comments Comments on all closing curly braces } Consistent indentation of 3 or 4 spaces (not
Program 2: Sphere.java . . Required: Header comments Inline comments Comments on all closing curly braces } Consistent indentation of 3 or 4 spaces (not tab) Consistent spacing (space on both sides of each operator) . . Write a Java program named Sphere.java. The program must perform the following tasks, in order: 1) Prompt and input a double value for the radius. 2) If the input value is negative, display an error message. 3) If the input value is not negative, a. Calculate the surface area. b. Calculate the volume. Print meaningful messages with the surface area and volume. c. Save, compile, debug, fix errors, repeat. Once the program compiles without error, run. Compare expected output to actual output. Debug as needed. . Remember that you can submit a partially-completed program for partial credit. Submit something by the due date
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
