I have some words underlined that are important to understan
Solution
Circle.java
/*
* Name:
* Filename:Class.java
* Description: This program will calculate the Area of the circle.
*/
import java.util.Scanner;
public class Circle {
public static void main(String[] args) {
//Scanner object is used to get the inputs entered by the user
Scanner sc=new Scanner(System.in);
//Declaring vsriables
String firstname;
String lastname;
int yearOfGraduation;
double radius;
double area;
//Declaring constant
final double PI=3.1415;
//Getting the first name entered by the user
System.out.print(\"Enter the Firstname :\");
firstname=sc.next();
//Getting the last name entered by the user
System.out.print(\"Enter the Lastname :\");
lastname=sc.next();
//Getting the Year of Graduation entered by the user
System.out.print(\"Enter Year of Graduation :\");
yearOfGraduation=sc.nextInt();
//Getting the radius entered by the user
System.out.print(\"Enter the Radius :\");
radius=sc.nextDouble();
//calculating the area of the circle
area=PI*radius*radius;
//displaying the output
System.out.println(\"\ First/Last Name :\"+firstname+\" \"+lastname);
System.out.println(\"Graduation Year :\"+yearOfGraduation);
System.out.println(\"Circle Radius :\"+radius);
System.out.println(\"Circle Diameter :\"+2*radius);
System.out.printf(\"Circle Area : %.2f\",area);
}
}
____________________
output:
Enter the Firstname :John
Enter the Lastname :Smith
Enter Year of Graduation :2019
Enter the Radius :5.5
First/Last Name :John Smith
Graduation Year :2019
Circle Radius :5.5
Circle Diameter :11.0
Circle Area : 95.03
___________Thank You

