- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExecutive.java
More file actions
Latest commit
91 lines (75 loc) · 3.59 KB
/
Copy pathExecutive.java
File metadata and controls
91 lines (75 loc) · 3.59 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
/*
******************************* My changes were***************************************************************************************
1. adding extraVacation which is a instance data field holding the number of extra vacation days
2. added the vacation method
3. added the setExtraVacation method with sets the number of extra vacation days
4. added the getExVacation method which gets the curent value of instance data field holding the number of extra vacation days
p.s I know that the getter and setter methods were not asked for, but only make sence t be there
************************************************************Important***********************************************************************************
I Thomas Jessop only modifed this code and clam no ownership or credit for the orginal state of this program and only added documention to my edits
********************************************************************************************************************************************************
*@param extraVacation holds their numvber if extra vacation days
**/
//********************************************************************
// Executive.java Author: Lewis/Loftus
//
// Represents an executive staff member, who can earn a bonus.
//********************************************************************
publicclassExecutiveextendsEmployee
{
privatedoublebonus;
//holds their numvber if extra vacation days
privateintextraVacation;
//-----------------------------------------------------------------
// Constructor: Sets up this executive with the specified
// information.
//-----------------------------------------------------------------
publicExecutive(StringeName, StringeAddress, StringePhone,
StringsocSecNumber, doublerate, intexVacation)
{
super(eName, eAddress, ePhone, socSecNumber, rate);
//sets the number of extra vacation days
this.extraVacation = exVacation;
bonus = 0; // bonus has yet to be awarded
}
//-----------------------------------------------------------------
// Awards the specified bonus to this executive.
//-----------------------------------------------------------------
publicvoidawardBonus(doubleexecBonus)
{
bonus = execBonus;
}
//-----------------------------------------------------------------
// Computes and returns the pay for an executive, which is the
// regular employee payment plus a one-time bonus.
//-----------------------------------------------------------------
publicdoublepay()
{
doublepayment = super.pay() + bonus;
bonus = 0;
returnpayment;
}
/**
* Returns the sum of vacationDays and extarVacation
* @param vacationDays instance varible the holds the executive's number of standard vacation days.
* @param extarVacation instance varible the holds the executives number of extra vacation days.
*/
publicintvacation(){
return (vacationDays + extraVacation);
}
/**
* Setts the number of extra vacation days
* @param extraDays passed in for setting extraVacation
* @param extraVacation the instance data field holding the number of extra vacation days
*/
publicvoidsetExtraVacation(intextraDays){
this.extraVacation = extraDays;
}
/**
* gets the curent value of instance data field holding the number of extra vacation days
* @return extraVacation
*/
publicintgetExVacation(){
returnthis.extraVacation;
}
}