-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHouseTester.java
More file actions
55 lines (31 loc) · 1.52 KB
/
HouseTester.java
File metadata and controls
55 lines (31 loc) · 1.52 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
/**
Adoga Haruna. SRN: 13000236
*/
public class HouseTester
{
public static void main (String [] args)
{
House housetest = new House("No 9 Richards Street");
//create a new Time object to use in the TimeableLight constructor
Time current = new Time (31,12,2014,5, 38);
// add appliances to the house using the add appliance method created earlier
TimeableLight newlight = new TimeableLight("NewLight", "EnergySaving", 999, 10, "Bathroom", current, false);
Light bulb = new Light ("Bulb", "LED", 555, 50, "Toilet", false );
TimeableLight halogen = new TimeableLight ("Timedhalogen", "Halogen", 222, 20, "Kitchen", current, false);
housetest.addAppliance(newlight);
housetest.addAppliance(bulb);
housetest.addAppliance (halogen);
// System.out.println(housetest);
//test find appliance method
//System.out.println(housetest.findAppliance("Bulb"));
//test the turn on all appliances method
// housetest.turnOnAll();
//test the turn off all method
//housetest.turnOffAll();
//test the turn on appliance method by passing in an appliance name.
//housetest.turnOnApp("Timed");
housetest.removeAppliance(halogen);
System.out.println(housetest);
//System.out.println(housetest);
}
}