-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJudicial.java
More file actions
44 lines (37 loc) · 969 Bytes
/
Copy pathJudicial.java
File metadata and controls
44 lines (37 loc) · 969 Bytes
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
import java.text.DecimalFormat;
public class Judicial extends ElectedOfficial
{
private String courtType;
private double annualSalary;
public Judicial(String nam, String tit, int id, String beg, String end, String typ, double sal)
{
super(nam, tit, id, beg, end);
courtType = typ;
annualSalary = sal;
}
public Judicial()
{
super("Antonin Scalia", "Justice", 4, "September 26, 1986", "Incumbent");
courtType = "Supreme";
annualSalary = 210000.00;
}
public String getCourtType()
{
return courtType;
}
public double getAnnualSalary()
{
return annualSalary;
}
public String toString()
{
DecimalFormat dollar = new DecimalFormat("$###,##0.00");
return "Name: " + getName() +
"\nTitle: " + getTitle() +
"\nID: " + getID() +
"\nTerm Begin: " + getTermBegin() +
"\nTerm End: " + getTermEnd() +
"\nCourt Type: " + getCourtType() +
"\nAnnual Salary: " + dollar.format(getAnnualSalary()) + "\n";
}
}