The formula to compute the area of a circle is:
Area = πr2
where r is the radius of the sphere and π is 3.14159.
Assume a variable radius has already been declared (type double)and initialized with the value of the radius of a sphere.
Write JAVA statements to do the following:
• Declare a constant PI and initialize it to 3.14159
• Declare a variable area type double
• Calculate the area of the circle and store it in the variablearea.
• Display the computed area on the console.
Expert Answer
An answer will be send to you shortly. . . . .