-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAula.java
41 lines (33 loc) · 1.08 KB
/
Aula.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
package aula;
import java.util.Scanner;
public class Aula {
public static void main(String[] args) {
Scanner entrada = new Scanner(System.in);
System.out.println("Escolha um numero entre 3 e 5");
int soma = entrada.nextInt();
int num = 0;
int num2 = 0;
int total = 0;
System.out.println("Escolha dois numeros");
num = entrada.nextInt(); num2 = entrada.nextInt();
switch (soma) {
case 3:
total = num+num2;
total = total+(total*20)/100;
System.out.println(total);
break;
case 4:
total = num-num2;
total = total+(total*20)/100;
System.out.println(total);
break;
case 5:
total = num+num;
total = total-(total*5)/100;
System.out.println(total);
break;
default:
System.out.println("Aooo potência");
}
}
}