-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomer.java
More file actions
174 lines (157 loc) · 3.53 KB
/
Copy pathCustomer.java
File metadata and controls
174 lines (157 loc) · 3.53 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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/**
* Customer class
*
* @author jusps
* @version 1
*/
public class Customer {
private String name = "";
private String paymentMethod = "";
private String address = "";
private String additionalInfo = "";
//is premium. [0] is if have premium, [1] is if paid premium this month
private boolean[] isPremium = {false, false};
private double moneySpent = 0.0;
private int age = 18;
//constructor
public Customer(String name, String method, int age, boolean[] premium, String address, String moreInfo) {
this.name = name;
paymentMethod = method;
this.age = age;
isPremium = premium;
this.address = address;
additionalInfo = moreInfo;
}
/**
* gets the name
*
* @return String name
*/
public String getName() {
return this.name;
}
/**
* gets the payment method
*
* @return String paymentMethod
*/
public String getPayMethod() {
return paymentMethod;
}
/**
* gets the age
*
* return int age
*/
public int getAge() {
return age;
}
/**
* gets the premium status boolean array
* [0] is if premium, [1] is if paid
*
* @return boolean[] isPremium
*/
public boolean[] getPremiumStatus() {
//isPremium[0] is whether premium, isPremium[1] is if paid
//it kept giving me an error '.class expected' but for some reason this fixed it
return new boolean[] {isPremium[0], isPremium[1]};
}
/**
* gets whether premium or not
* [0] is if premium
*
* @return boolean isPremium
*/
public boolean isPremium() {
return isPremium[0];
}
/**
* gets the money spent
*
* @return double moneySpent
*/
public double getMoneySpent() {
return moneySpent;
}
/**
* gets the address
*
* @return String address
*/
public String getAddress() {
return address;
}
/**
* gets additional payment info
*
* @return String additionalInfo
*/
public String getInfo() {
return additionalInfo;
}
/**
* changes the name
*
* @param String name
*/
public void changeName(String name) {
this.name = name;
}
/**
* sets the payment method
*
* @param String method
*/
public void setPayMethod(String method) {
this.paymentMethod = method;
}
/**
* sets the age
*
* @param int age
*/
public void setAge(int age) {
this.age = age;
}
/**
* sets isPremium[0] to whether paid or not
*
* @param boolean isTrue
*/
public void setPremium(boolean isTrue) {
isPremium[0] = isTrue;
}
/**
* sets isPremium[1] to whether paid this month
*
* @param boolean isTrue
*/
public void setPaidThisMonth(boolean isTrue) {
isPremium[1] = isTrue;
}
/**
* adds money to the total money spent
*
* @param double munee
*/
public void addMoneySpent(double munee) {
moneySpent += munee;
}
/**
* sets the address
*
* @param String address
*/
public void setAddress(String address) {
this.address = address;
}
/**
* sets the additional payment information
*
* @param String additionalInfo
*/
public void setInfo(String additionalInfo) {
this.additionalInfo = additionalInfo;
}
}