forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab6 employee2.java
More file actions
53 lines (51 loc) · 1.42 KB
/
Copy pathLab6 employee2.java
File metadata and controls
53 lines (51 loc) · 1.42 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
49
50
51
52
53
/**
* Write a description of class Employee2 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Employee2
{
private int iDNumber;
private String name;
private double salary;
public Employee2(int iDNumber, String name, double salary) {
this.iDNumber = iDNumber;
this.name = name;
this.salary = salary;
}
public Employee2(String name, int iDNumber, double salary) {
this(iDNumber, name, salary);
}
public Employee2(int iDNumber, String name) {
this(iDNumber, name, 0.0);
}
public Employee2(String name, int iDNumber) {
this(iDNumber, name, 0.0);
}
public void setSalary(double salary) {
this.salary = salary;
}
public int getIDNumber() {
return iDNumber;
}
public String getName() {
return name;
}
public double getSalary() {
return salary;
}
public void deductions(double telephoneBills) {
salary -= telephoneBills;
}
public void deductions(double telephoneBills, double medicalBills) {
salary -= (telephoneBills + medicalBills);
}
public void raiseSalary(double percentIncrease) {
salary += salary * percentIncrease/100;
}
public void printDetails() {
System.out.println("\nID Number: "+iDNumber+"\nName: "+name+"\nSalary:"+salary);
}
}