# Area, and Circumference of a Circle in Java

Oct 13, 2021

Machine Problem

Write a program  to ask the user to give the radius of a circle, then the program   will calculate, and display the area and circumference of the circle on the screen using Java programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.

My mobile number here in the Philippines is 09173084360.

Program Listing

``````// area_circumference_circle.java
// Bacolod City, Negros Occidental Philippines

/*
* Machine Problem
*
* Write a program  to ask the user to give the radius of a circle, then the program
* will calculate, and display the area and circumference of the circle on the screen.
*
*/

import java.util.Scanner;
import java.math.RoundingMode;
import java.text.DecimalFormat;

public class area_circumference_circle {

private static DecimalFormat df2 = new DecimalFormat("#.##");

public static void main(String[] args) {

double area=0.00, circumference=0.00;

Scanner scan = new Scanner(System.in);

System.out.println();
System.out.print("\tArea, and Circumference of a Circle in Java ");
System.out.println("\n");

System.out.print("\tGive the Radius of the Circle : ");

circumference = (2 * 3.14 * radius);

System.out.println("\n");
System.out.print("\tThe Area of The Circle : " + df2.format(area));
System.out.println("\n");
System.out.print("\tThe Circumference of The Circle : " + df2.format(circumference));
System.out.println("\n");
System.out.println("\tEnd of Program");
System.out.println();
}
}
``````