-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAula4.java
More file actions
48 lines (36 loc) · 1.34 KB
/
Aula4.java
File metadata and controls
48 lines (36 loc) · 1.34 KB
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
/*
* 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 Aula4 {
public static void main (String[]args){
Scanner entrada = new Scanner (System.in);
int a = 0, 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 ou 5 ");
int codigo = entrada.nextInt();
switch (codigo){
case 3:
System.out.println((a+b)+(20*(a+b))/100);
break;
case 4:
System.err.println((b-a)+(20*(a+b))/100);
break;
case 5:
System.err.println((a+a)+(20*(a+b))/100);
break;
default:
System.out.println("Código Inexistente");
}
}
}