8) Create the following program using Java.
Circle calculation using methods
Create scanner
declare double variable radius = -999
declare character choice
create do while loop
inside of do loop write:
System.out.println();
System.out.println(\"*** CIRCLE CALCULATIONS ***\");
System.out.println();
System.out.println(\"1. Enter the radius of the circle\");
System.out.println(\"2. Display the area of the circle\");
System.out.println(\"3. Display the circumference of thecircle\");
System.out.println(\"4. Quit\");
System.out.println();
System.out.println(\"Enter a number from 1 - 4\");
System.out.println();
Declare choice character and relate to scanner
declare switch (choice)
case 1 radius which is equal to option1 method
case 2 call option2(radius)
case 3 call option3(radius)
case 4 quit
default
prompt the user to enter numbers from 1 - 4
close bracket
while condition choice !='4'
create method static double option1 gets the user to enter theradius of the circle
declare myradius variable double
declare a scanner
prompt the user to enter the radius of circle and relate tovariable above with scaner
return the variable
create method static void option2 with parameter doubleradiusin
check condition id radiusin is equal to -999 display the message inconsole no radius is entered
else
declare variable double area
area is equal to 3.14 * radiusin * radiusin
display in console the area
create method static void option3 with parameter doubleradiusin
check condition id radiusin is equal to -999 display the message inconsole no radius is entered
else
declare variable double circumference
circumference is equal to 2 * 3.14 * radiusin
display in console the circumference