forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab6Employee3.java
More file actions
51 lines (50 loc) · 1.4 KB
/
Copy pathLab6Employee3.java
File metadata and controls
51 lines (50 loc) · 1.4 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
/**
* Write a description of class Employee3 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Employee3
{
private int iDNumber;
private String name;
private double salary;
public Employee3(int iDNumber, String name, double salary) {
this.iDNumber = iDNumber;
this.name = name;
this.salary = salary;
}
public Employee3(String name, int iDNumber, double salary) {
this(iDNumber, name, salary);
}
public Employee3(int iDNumber, String name) {
this(iDNumber, name, 0.0);
}
public Employee3(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 String toString() {
return "\nID Number: "+iDNumber+"\nName: "+name+"\nSalary:"+salary;
}
}