Lately I have decided that I would get back into the swing of things with Java. So as a first small project I made this. Nothing fancy, just something to get me going again.
Code:
import java.util.Scanner;
public class SectorArea {
public static void main(String[] args) {
double radius, degrees, AreaOfSector; //Declarations for later.
Scanner scan = new Scanner(System.in); //Creating a scanner
System.out.println("Enter the radius of the circle.");
radius = scan.nextDouble(); //Setting radius equal to userinputed value.
System.out.println("Now please enter the number of degrees of the sector.");
degrees = scan.nextDouble();
AreaOfSector = ((Math.pow(radius, 2) * 3.14) * degrees) / 360; //The actual math part. :D
System.out.println("The area of your sector is equal to: " + AreaOfSector);
}
}