-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEmployee.java
More file actions
99 lines (90 loc) · 2.28 KB
/
Employee.java
File metadata and controls
99 lines (90 loc) · 2.28 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/**
* @author Michael Chadwick
* @version 4/22/20
*/
public class Employee
{
private int empNum;
private String empName;
private double empSalary;
/**
* Default constructor.
* @param empNum sets variables value to zero.
* @param empName sets variables value to an empty space.
* @param empSalary sets variables value to zero.
*/
public Employee()
{
empNum = 0;
empName = " ";
empSalary = 0.0;
}
/**
* Constructor for objects of class Employee.
* @param empNum sets variables value.
* @param empName sets variables value.
* @param empSalary sets variables value.
*/
public Employee(int empNum, String empName, double empSalary)
{
this.empNum = empNum;
this.empName = empName;
this.empSalary = empSalary;
}
/**
* This method returns the objects employee number.
* @return empNum returns Employee's number.
*/
public int getEmp_Num()
{
return this.empNum;
}
/**
* This method sets the objects employee number.
* @param empNum sets Employee's number.
*/
public void setEmp_Num(int empNum)
{
this.empNum = empNum;
}
/**
* This method returns the objects Employee name.
* @return empName returns Employee's name.
*/
public String getEmp_Name()
{
return this.empName;
}
/**
* This method sets the objects Employee name.
* @param empName sets Employee's name.
*/
public void setEmp_Name(String empName)
{
this.empName = empName;
}
/**
* This method returns the objects Employee salary.
* @return empSalary returns Employee's salary.
*/
public double getEmp_Salary()
{
return this.empSalary;
}
/**
* This method sets the objects Employee salary.
* @param empSalary sets Employee's salary.
*/
public void setEmp_Salaray(double empSalary)
{
this.empSalary = empSalary;
}
/**
* This method creates and displays a string with the three elements of an Employee object.
*/
@Override
public String toString()
{
return "~ Employee Number: " + empNum + " Name: " + empName + " Salary: $" + empSalary + " ~";
}
}