-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTestMember.java
More file actions
26 lines (26 loc) · 1.14 KB
/
TestMember.java
File metadata and controls
26 lines (26 loc) · 1.14 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
public class TestMember {
public static void main(String[] args) {
// create the members
Member jane = new StandardMember("Jane", "1 queen st. ");
Member mike = new SeniorMember("mike", "1 king st. ", 60);
Member noah = new SeniorMember("Noah", "100 king st. ", 40);
// create the society
Society ontarioTech = new Society("ontario Tech");
// add members to the socitey
ontarioTech.addMember(mike);
ontarioTech.addMember(jane);
ontarioTech.addMember(noah);
// create the Managment committee
ManagementCttee managementCttee = new ManagementCttee();
// check if Mike is a senior member in the society
if (mike.isSeniorMember()) {
managementCttee.addMember((SeniorMember) mike);
}
// add the management committee to the scoiety
ontarioTech.setManagementCttee(managementCttee);
// list all the members in the committee
ontarioTech.listAllMemebrs();
// list all the members in the committee
System.out.println("Total Fee: " + ontarioTech.getFeeTotal());
}
}