- 3
- 1
- 约2.06万字
- 约 28页
- 2015-09-26 发布于重庆
- 举报
拓胜技术专家教你如何深入理解设计模式(策略模式)
——
(Strategy)
1.1
CRM
5%
10%
1.2
/**
*
*/
public class Price {
1/28
/**
*
* @param goodsPrice
* @param customerType
* @return
*/
public double quote(double goodsPrice,String customerType){
if(customerType.equals()){
System.out.println();
return goodsPrice;
}else if(customerType.equals()){
System.out.println(5%);
return goodsPrice*(1-0.05);
}else if(customerType.equals()){
System.out.println(10%);
return goodsPrice*(1-0.1);
}
//
return goodsPrice;
}
}
1.3
/**
*
*/
public class Price {
/**
*
* @param goodsPrice
* @param customerType
* @return
*/
public double quote(double goodsPrice,String customerType){
2/28
if(customerType.equals()){
return this.calcPriceForNormal(goodsPrice);
}else if(customerType.equals()){
return this.calcPriceForOld(goodsPrice);
}else if(customerType.equals()){
return this.calcPriceForLarge(goodsPrice);
}
//
return goodsPrice;
}
/**
*
* @param goodsPrice
* @return
*/
private double calcPriceForNormal(double goodsPrice){
System.out.println();
return goodsPrice;
}
/**
*
* @param goodsPrice
* @return
*/
private double calcPriceForOld(double goodsPrice){
System.out.println(5%);
return goodsPrice*(1-0.05);
}
/**
*
* @param goodsPrice
* @return
*/
private double calcPriceForLarge(double goodsPrice){
System.out.println(10%);
return goodsPrice*(1-0.1);
您可能关注的文档
- 建筑结构抗震设计原理 课后思考题.doc
- 建筑砂浆抗压强度等级划分.doc
- 建筑英语 中英文对照by Iris.doc
- 建造师考试及建筑工程领域常用软件教程视频教程地址(很有用的).xls
- 建筑项目与工程管理上课专业词汇.doc
- 开关功率变换器中的间歇现象理论分析.pdf
- 开关电源LED PSU的能效计算公式.xls
- 开发基于PlugInFrame的ImageJ插件.doc
- 开放式基金投资数学模型论文.doc
- 开源软件的商业模式和研究.doc
- 全过程工程管理造价咨询工程监理项目服务方案投标方案(技术部分).doc
- 招标代理服务投标技术服务方案(技术方案).doc
- AI大模型与AIGC技术在公安领域的应用解决方案(99页 PPT).pptx
- 工业4.0智能制造数字工厂规划方案.pptx
- 树立社会主义核心价值观.docx
- 三年(2023-2025)中考历史真题分类汇编(全国)专题21 科技文化与社会生活(解析版).docx
- 2025年中考道德与法治真题完全解读(吉林卷).pdf
- 2025年中考道德与法治真题完全解读(安徽卷).pdf
- 三年(2023-2025)中考历史真题分类汇编(全国)专题14 人民解放战争(解析版).pdf
- 三年(2023-2025)广东中考历史真题分类汇编:专题03 中国近代史(八年级上册)(解析版).docx
原创力文档

文档评论(0)