-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExecutive.java
More file actions
54 lines (45 loc) · 1.05 KB
/
Copy pathExecutive.java
File metadata and controls
54 lines (45 loc) · 1.05 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
import java.text.DecimalFormat;
public class Executive extends ElectedOfficial
{
private String party;
private double annualSalary;
public Executive(String nam, String tit, int id, String beg, String end, String pty, double sal)
{
super(nam, tit, id, beg, end);
party = pty;
annualSalary = sal;
}
public Executive()
{
super("Barack Obama", "President", 0, "December 18, 2008", "Incumbent");
party = "Democrat";
annualSalary = 350000.00;
}
public String getParty()
{
return party;
}
public double getAnnualSalary()
{
return annualSalary;
}
public void setParty(String pty)
{
party = pty;
}
public void setAnnualSalary(double sal)
{
annualSalary = sal;
}
public String toString()
{
DecimalFormat dollar = new DecimalFormat("$###,##0.00");
return "Name: " + getName() +
"\nTitle: " + getTitle() +
"\nID: " + getID() +
"\nTerm Begin: " + getTermBegin() +
"\nTerm End: " + getTermEnd() +
"\nParty: " + getParty() +
"\nAnnual Salary: " + dollar.format(getAnnualSalary()) + "\n";
}
}