-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathElectedOfficial.java
More file actions
96 lines (82 loc) · 1.88 KB
/
Copy pathElectedOfficial.java
File metadata and controls
96 lines (82 loc) · 1.88 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
/*
* CS 162J Lab 3 A: Elected Officials
* Author: Te-Feng (Dylan) Pan
*/
public class ElectedOfficial
{
protected String name, title, termBegin, termEnd;
protected int employeeID;
public ElectedOfficial(String nam, String tit, int id, String beg, String end)
{
name = nam;
title = tit;
employeeID = id;
termBegin = beg;
termEnd = end;
}
public String getName()
{
return name;
}
public String getTitle()
{
return title;
}
public int getID()
{
return employeeID;
}
public String getTermBegin()
{
return termBegin;
}
public String getTermEnd()
{
return termEnd;
}
public void setName(String nam)
{
name = nam;
}
public void setTitle(String tit)
{
title = tit;
}
public void setID(int id)
{
employeeID = id;
}
public void setTermBegin(String beg)
{
termBegin = beg;
}
public void setTermEnd(String end)
{
termEnd = end;
}
//override
public String toString()
{
return "Name: " + getName() +
"\nTitle: " + getTitle() +
"\nID: " + getID() +
"\nTerm Begin: " + getTermBegin() +
"\nTerm End: " + getTermEnd() +
"\n";
}
public static void main(String[] args)
{
Executive gov = new Executive("John Kitzhaber", "Governor", 0, "January 10, 2011", "Incumbent", "Democrat", 128000.00);
ElectedOfficial sec = new ElectedOfficial("Ellen F. Rosenblum", "Attorney General", 1, "April 6, 2009", "February 1, 2013");
Legislator sen = new Legislator("Bob Lee", "Senator", 2, "August 17, 2001", "January 10, 2009", "Republican", 6, 350.00, 500.00);
Legislator rep = new Legislator();
Judicial sup = new Judicial();
Judicial jud = new Judicial("Nancy Jansons", "Senior Judge", 5, "January 3, 1995", "Incumbent", "County", 115000.00);
System.out.println(gov);
System.out.println(sec);
System.out.println(sen);
System.out.println(rep);
System.out.println(sup);
System.out.println(jud);
}
}