forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLab6Employee1.java
More file actions
57 lines (57 loc) · 1.56 KB
/
Copy pathLab6Employee1.java
File metadata and controls
57 lines (57 loc) · 1.56 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
54
55
56
57
/**
* Write a description of class Employee1 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Employee1
{
private int iDNumber;
private String name;
private double salary;
public Employee1(int iD, String employeeName, double employeeSalary){
iDNumber = iD;
name = employeeName;
salary = employeeSalary;
}
public Employee1(String employeeName, int iD, double employeeSalary){
iDNumber = iD;
name = employeeName;
salary = employeeSalary;
}
public Employee1(int iD, String employeeName) {
iDNumber = iD;
name = employeeName;
salary = 0.0;
}
public Employee1(String employeeName, int iD) {
iDNumber = iD;
name = employeeName;
salary = 0.0;
}
public void setSalary(double employeeSalary) {
salary = employeeSalary;
}
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) ;
}
}