-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAula30Exercicio6.java
More file actions
38 lines (27 loc) · 997 Bytes
/
Copy pathAula30Exercicio6.java
File metadata and controls
38 lines (27 loc) · 997 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import java.util.Locale;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Locale.setDefault(Locale.US);
double A, B, C, pi, triangulo, circulo, trapezio, quadrado, retangulo;
pi = 3.14159;
Scanner sc = new Scanner(System.in);
System.out.printf("Insira o valor A: %n");
A = sc.nextDouble();
System.out.printf("Insira o valor B: %n");
B = sc.nextDouble();
System.out.printf("Insira o valor C: %n");
C = sc.nextDouble();
sc.close();
triangulo = (A * C) /2;
circulo = pi * Math.pow(C, 2);
trapezio = ((A + B) * C) /2;
quadrado = Math.pow(B, 2);
retangulo = A * B;
System.out.printf("A area do triangulo é: %.3f %n", triangulo);
System.out.printf("A area do circulo é: %.3f %n", circulo);
System.out.printf("A area do trapezio é: %.3f %n", trapezio);
System.out.printf("A area do quadrado é: %.3f %n", quadrado);
System.out.printf("A area do retangulo é: %.3f %n", retangulo);
}
}