-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUri1048.java
More file actions
44 lines (36 loc) · 1.2 KB
/
Uri1048.java
File metadata and controls
44 lines (36 loc) · 1.2 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
import java.util.Scanner;
class Uri1048{
public static void main(String[] args){
double salario, perc = 0, newSal = 0, reaj = 0;
Scanner input = new Scanner(System.in);
salario = input.nextDouble();
if(salario >= 0 && salario <= 400){
perc = 0.15;
newSal = salario * (perc + 1);
reaj = newSal - salario;
}
if(salario > 400 && salario <= 800){
perc = 0.12;
newSal = salario * (perc + 1);
reaj = newSal - salario;
}
if(salario > 800 && salario <= 1200){
perc = 0.10;
newSal = salario * (perc + 1);
reaj = newSal - salario;
}
if(salario > 1200 && salario <= 2000){
perc = 0.07;
newSal = salario * (perc + 1);
reaj = newSal - salario;
}
if(salario > 2000){
perc = 0.04;
newSal = salario * (perc + 1);
reaj = newSal - salario;
}
System.out.printf("%s%.2f%n","Novo salario: ", newSal);
System.out.printf("%s%.2f%n","Reajuste ganho: ", reaj);
System.out.println("Em percentual: " + (int)(perc * 100) + " %");
}
}