forked from cs-dept-ibbul/java2019
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee1.java
More file actions
60 lines (59 loc) · 1.64 KB
/
Copy pathEmployee1.java
File metadata and controls
60 lines (59 loc) · 1.64 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
58
59
60
/*
* 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 Employee1;
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) ;
}
}