-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathqb300.java
More file actions
28 lines (21 loc) · 711 Bytes
/
qb300.java
File metadata and controls
28 lines (21 loc) · 711 Bytes
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
import java.util.*;
import java.io.*;
class QB300 {
public static void main(String[] args) throws IOException {
FileWriter fw = new FileWriter("tax.txt");
BufferedWriter bw = new BufferedWriter(fw);
Scanner sc = new Scanner(System.in);
for (int i = 1; i <= 5; i++) {
System.out.println("Enter Salary of Employee " + i);
Double salary = sc.nextDouble();
Double tax = taxcounter(salary);
bw.write("Employee" + i + ":" + tax + "/- ₹ Tax.");
bw.newLine();
}
bw.close();
}
static Double taxcounter(double salary) {
Double taxrate = 0.10;
return salary * taxrate;
}
}