-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAulaGithub.java
57 lines (46 loc) · 1.46 KB
/
AulaGithub.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
48
49
50
51
52
53
54
55
56
57
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package javaapplication1;
import java.util.Scanner;
/**
*
* @author Aluno
*/
public class JavaApplication1 {
/**
* @param args
*/
public static void main(String[] args){
Scanner entrada = new Scanner(System.in);
int a=0;
int b=0;
System.out.println(" informe o valor de A");
a = entrada.nextInt();
System.out.println(" informe o valor de B");
b = entrada.nextInt();
System.out.println(" informe o código 3, 4, 5");
int codigo= entrada.nextInt();
switch (codigo){
case 3:
System.out.println(a=a+b);
System.out.println(a=a+(a*20)/100);
System.out.println(" valor de a+ b + 20% "+a);
break;
case 4:
b= b-a;
b=b+(b*20)/100;
System.out.println(" b-a mais 20% "+ b);
break;
case 5:
a= a+a;
a= a-(a*5)/100;
System.out.println(" valor de a + a - 5%= "+a);
break;
default:
System.out.println("Código inexistente");
}
}
}