frequentbuyer.java
来自「此程序都是企业级 的数据库开发程序 全面揭示了JAVA对数据库的操作」· Java 代码 · 共 38 行
JAVA
38 行
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 + =
减小字号Ctrl + -
显示快捷键?