Question: The language is Java Calculate the area of circle given its radius. Use Math.PI for pi, Math.pow( ) to square the radius, and the following
The language is Java Calculate the area of circle given its radius. Use Math.PI for pi, Math.pow( ) to square the radius, and the following template.
The template for this program is:
import javax.swing.*;
public class CircleArea {
public static void main (String [] args) {
double radius;
double area;
String input =
JOptionPane.showInputDialog(Enter the radius);
radius = Double.parseDouble(input);
// put the problem solution here
JOptionPane.showMessageDialog(null,
String.format(Area: %.2f, area));
return;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
