-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLegislator.java
More file actions
80 lines (68 loc) · 1.58 KB
/
Copy pathLegislator.java
File metadata and controls
80 lines (68 loc) · 1.58 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
import java.text.DecimalFormat;
public class Legislator extends ElectedOfficial
{
private String party;
private int district;
private double dailyPayRate, travelerDiemRate;
public Legislator(String nam, String tit, int id, String beg, String end, String pty, int dst, double day, double diem)
{
super(nam, tit, id, beg, end);
party = pty;
district = dst;
dailyPayRate = day;
travelerDiemRate = diem;
}
public Legislator()
{
super("John Cook", "Superintendent of Public Instruction", 3, "January 10, 2009", "Incumbent");
party = "Republican";
district = 3;
dailyPayRate = 533.33;
travelerDiemRate = 555.00;
}
public String getParty()
{
return party;
}
public int getDistrict()
{
return district;
}
public double getDailyPayRate()
{
return dailyPayRate;
}
public double getTravelerDiemRate()
{
return travelerDiemRate;
}
public void setParty(String pty)
{
party = pty;
}
public void setDistrict(int dst)
{
district = dst;
}
public void setDailyPayRate(double day)
{
dailyPayRate = day;
}
public void setTravelerDiemRate(double diem)
{
travelerDiemRate = diem;
}
public String toString()
{
DecimalFormat dollar = new DecimalFormat("$###,##0.00");
return "Name: " + getName() +
"\nTitle: " + getTitle() +
"\nID: " + getID() +
"\nTerm Begin: " + getTermBegin() +
"\nTerm End: " + getTermEnd() +
"\nParty: " + getParty() +
"\nDistrict: " + getDistrict() +
"\nDaily Pay: " + dollar.format(getDailyPayRate()) +
"\nTraveler Diem Rate: " + dollar.format(getTravelerDiemRate()) + "\n";
}
}