-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomer.java
48 lines (46 loc) · 1.49 KB
/
Customer.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
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package lima;
/**
*
* @author Mus
*/
class Customer extends Person {
String customerNumber;
boolean mailingList;
//Constructors
public Customer(String name, String address, String telephoneNumber, String customerNumber, boolean mailingList){
super(name, address, telephoneNumber);
this.customerNumber = customerNumber;
this.mailingList = mailingList;
}
//"setCustomerNumber" stores the parameter value "customerNumber"
public void setCustomerNumber(String customerNumber){
this.customerNumber = customerNumber;
}
//"setMailOnOff" stores the parameter value for "mailingList"
public void setMailOnOff(boolean mailingList){
this.mailingList = mailingList;
}
//"getMailOnOff" returns the parameter value "mailingList"
public String getMailOnOff()
{
if(mailingList)
return "Yes";
else
return "No";
}
//"getCustomerNumber" returns the parameter value "customerNumber"
public String getCustomerNumber(){
return customerNumber;
}
public String toString(){
String customer = super.toString() + "\nCustomer Number: "
+ getCustomerNumber() + "\nCustomer MailList: " +
getMailOnOff();
return customer;
}
}