package ConditionalStatementsLab;
import java.util.Scanner;
public class AreaOfFigures_07 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String name = scanner.nextLine();
if (name.equals("square")){
double a = Double.parseDouble(scanner.nextLine());
double result = a * a;
System.out.printf("%.3f", result);
} else if (name.equals("rectangle")) {
double a = Double.parseDouble(scanner.nextLine());
double b = Double.parseDouble(scanner.nextLine());
double result = a * b;
System.out.printf("%.3f", result);
} else if (name.equals("circle")) {
double a = Double.parseDouble(scanner.nextLine());
double result = Math.PI * (a * a);
System.out.printf("%.3f", result);
} else if (name.equals("triangle")) {
double a = Double.parseDouble(scanner.nextLine());
double b = Double.parseDouble(scanner.nextLine());
double result = (a * b) / 2 ;
System.out.printf("%.3f", result);
}
}
}