-
Notifications
You must be signed in to change notification settings - Fork 1
/
exercicio_7_coordenadas_quadrante.java
47 lines (34 loc) · 1.06 KB
/
exercicio_7_coordenadas_quadrante.java
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
39
40
41
42
43
44
45
46
47
import java.util.Locale;
import java.util.Scanner;
public class exercicio_7_coordenadas_quadrante {
public static void main(String[] args) {
Locale.setDefault(Locale.US);
Scanner sc = new Scanner (System.in);
System.out.println("Digite o valor de X no plano cartesiano: ");
double x = sc.nextDouble();
System.out.println("Digite o valor de Y no plano cartesiano: ");
double y = sc.nextDouble();
if (x > 0 && y > 0) {
System.out.println("O número está no quadrante Q1.");
}
else if (x < 0 && y > 0) {
System.out.println("O número está no quadrante Q2.");
}
else if (x < 0 && y < 0) {
System.out.println("O número está no quadrante Q3.");
}
else if (x > 0 && y < 0) {
System.out.println("O número está no quadrante Q4.");
}
else if (x == 0 && y == 0) {
System.out.println("O número está na origem central: 0.");
}
else if (x == 0) {
System.out.println("O número está no Eixo Y.");
}
else if (y == 0) {
System.out.println("O número está no Eixo X.");
}
sc.close();
}
}