-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathManagementCompany.java
More file actions
124 lines (80 loc) · 1.92 KB
/
ManagementCompany.java
File metadata and controls
124 lines (80 loc) · 1.92 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
package assignment4;
public class ManagementCompany {
int index=0;
private int MAX_PROPERTY = 5;
private double mgmFeePer;
private String name="";
private Plot plot;
private Property[] properties=new Property[MAX_PROPERTY];
private String taxID="";
public ManagementCompany(String name, String taxID, int mgmFee) {
this.name=name;
this.taxID=taxID;
this.mgmFeePer =mgmFee;
}
public int addProperty(Property property) {
if(index>=MAX_PROPERTY){
return -1;
}else{
properties[index]=property;
index++;
return index-1;
}
}
public ManagementCompany(String name, String taxID, int mgmFee,int x, int y, int width, int depth) {
}
public int getMAX_PROPERTY() {
return MAX_PROPERTY;
}
public double getMgmFeePer() {
return mgmFeePer;
}
public String getName() {
return name;
}
public Plot getPlot() {
return plot;
}
public String getTaxID() {
return taxID;
}
public void setMgmFeePer(double mgmFeePer) {
this.mgmFeePer= mgmFeePer;
}
public void setName(String name) {
this.name=name;
}
public void setPlot(Plot plot) {
}
public double totalRent() {
double totalRent = 0;
for(int i=0;i<properties.length;i++){
totalRent+=properties[i].getRentAmount();
}
return totalRent;
}
public double maxRentProp() {
return MAX_PROPERTY;
}
public int maxRentPropertyIndex() {
double maxRent=0;
int maxRentIndex=0;
for(int i=0;i<properties.length;i++){
if(maxRent<properties[i].getRentAmount()){
maxRent=properties[i].getRentAmount();
maxRentIndex=i;
}
}
return maxRentIndex;
}
public String displayPropertyAtIndex(int index) {
String output=properties[index].toString();
return output;
}
public String toString() {
for(int i=0;i<properties.length;i++){
properties[i].toString();
}
return ("List of the properties for Mananagemen Company, " + "total management Fee:"+this.mgmFeePer);
}
}