-
Notifications
You must be signed in to change notification settings - Fork 0
/
Store.java
60 lines (47 loc) · 1.54 KB
/
Store.java
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
//The father class that represents how a store works
package store;
public class Store {
private String address;
private String storeName;
private int employeeCount;
public Store() {
this("", "", 0);
}
public Store(String address, String storeName, int employeeCount){
this.address = address;
this.storeName = storeName;
this.employeeCount = employeeCount;
}
public String toString(){
String s1 = "Address: " + this.getAddress() + "\n" +
"Store name: " + this.getStoreName() + "\n" +
"Employee count: " + this.getEmployeeCount();
return s1;
}
public void openShop() {
System.out.println("Opening the doors");
System.out.println("The store " + this.getStoreName() + " is now open!");
}
public void closeShop() {
System.out.println("Closing the doors");
System.out.println("The store " + this.getStoreName() + " is now closed!");
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getStoreName() {
return this.storeName;
}
public void setStoreName(String storeName) {
this.storeName = storeName;
}
public int getEmployeeCount() {
return this.employeeCount;
}
public void setEmployeeCount(int employeeCount) {
this.employeeCount = employeeCount;
}
}