forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee3.java
More file actions
53 lines (52 loc) · 1.49 KB
/
Copy pathEmployee3.java
File metadata and controls
53 lines (52 loc) · 1.49 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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//MATRIC NUMBER:U16/FNS/CSC/2087;
//NAME:Abdullahi idris;
package Employee3;
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;
}
}