📄 frequentbuyer.java
字号:
import java.util.*;
import org.jlf.log.*;
import org.jlf.dataMap.*;
/**
* This class hold information for a customer who is a
* frequent buyer, to give discounts in reward for their loyalty.
*/
public class FrequentBuyer extends VolumeCustomer {
/**
* Main constructor for the class. Populates all
* attributes of the class and sets the type accordingly.
*/
public FrequentBuyer(String nickname, String emailAddress, String name,
String address, String city, String state,
String zipcode) {
super(nickname, emailAddress, name, address, city, state, zipcode);
resetCustomerType(CustomerType.FREQUENT_BUYER);
}
/**
* Default constructor must be public for the data mapping
* framework! However, when creating a new object, look to use
* a paramterized constructor.
*/
public FrequentBuyer() {}
/**
* Return the amount of discount applicable to the volume
* customer. Give a 5% discount to all frequent buyers.
*/
public double discountRate() {
return 0.05;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -