-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path1051.java
55 lines (44 loc) · 912 Bytes
/
1051.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
import java.io.IOException;
import java.util.Locale;
import java.util.Scanner;
/*
*
*/
public class Main {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner(System.in);
Locale.setDefault(Locale.US);
float salary;
salary = sc.nextFloat();
if(salary<=2000.00) {
System.out.println("Isento");
}
else {
float tax=salary-2000;
float tribute=0;
if(tax>=0.01) {
if(tax<=1000) {
tribute=(float)(tax*0.08);
tax=0;
}else{
tribute=(float)(1000*0.08);
tax=tax-1000;
}
}
if(tax>=0.01) {
if(tax<=1500) {
tribute=tribute+(float)(tax*0.18);
tax=0;
}else {
tribute=tribute+(float)(1500*0.18);
tax=tax-1500;
}
}
if(tax>=0.01) {
tribute=tribute+(float)(tax*0.28);
}
System.out.println("R$ "+String.format("%.2f", tribute));
}
sc.close();
}
}