
How does one write a program to calculate the area of a circle in BlueJ? Note that the user will have to provide the radius.

A simple program to calculate the area of a circle. radius provided by user.
this is what i got but i can't compile it without an error. please help if you identify my mistake.
public class stage1 { // BEGIN Area of Circle
/**
* Get radius from user
* Set area = Math.Pi * radius * radius
* Output "Area : " area
* END Area of Circle
*/
public static void main(String [] areaCircle)
{
Scanner keyboard = new Scanner(System.in);
System.out.println("Enterh the circle's radius: ");
double radius = keyboard.nextDouble();
System.out.println("int Area");
}
}

import java.util.Scanner;
public class AreaOfCircle {
public static void main(String [] str)
{
Scanner keyboard = new Scanner(System.in);
System.out.println("Enter the circle's radius: ");
double radius = keyboard.nextDouble();
double PI=3.14;
double area=PI*radius*radius;
System.out.println("Area of circle: "+area);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.