资源简介
根据售卖咖啡的过程,客户先选择一种口味的咖啡,又选择不同种类的配料,由于配料选择是不定的,符合装饰模式的应用情况。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace SellCoffee
{
//咖啡父类
abstract class SellCoffee
{
//咖啡总价格
protected static int totalprice = 0;
public virtual void Add() { }
public int GetTotalPrice() { return totalprice; }
public void SetTotalPrice(int num) { totalprice = num; }
}
class Coffee:SellCoffee
{
protected string coffeeName;
protected int coffeePrice;
public Coffee(string nameint price)
{
coffeeName = name;
coffeePrice = price;
}
//计算单独奶茶价格
public override void Add()
{
totalprice = totalprice + coffeePrice;
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\.vs\
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\.vs\SellCoffee\
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\.vs\SellCoffee\v15\
文件 57856 2018-07-02 09:47 售卖咖啡(使用装饰者模式)\SellCoffee\.vs\SellCoffee\v15\.suo
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\.vs\SellCoffee\v15\Server\
目录 0 2018-07-02 09:47 售卖咖啡(使用装饰者模式)\SellCoffee\.vs\SellCoffee\v15\Server\sqlite3\
文件 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\.vs\SellCoffee\v15\Server\sqlite3\db.lock
文件 602112 2018-07-01 16:47 售卖咖啡(使用装饰者模式)\SellCoffee\.vs\SellCoffee\v15\Server\sqlite3\storage.ide
目录 0 2018-07-01 15:51 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\
文件 189 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\App.config
文件 871 2018-07-01 15:26 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Coffee.cs
文件 7673 2018-07-01 15:18 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Form1.Designer.cs
文件 5114 2018-07-01 15:51 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Form1.cs
文件 5817 2018-07-01 15:18 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Form1.resx
文件 2479 2018-07-01 15:50 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Ingredient.cs
文件 522 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Program.cs
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Properties\
文件 1332 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Properties\AssemblyInfo.cs
文件 2833 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Properties\Resources.Designer.cs
文件 5612 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Properties\Resources.resx
文件 1097 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Properties\Settings.Designer.cs
文件 249 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\Properties\Settings.settings
文件 3645 2018-06-21 16:30 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\SellCoffee.csproj
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\bin\
目录 0 2018-06-21 16:30 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\bin\Debug\
文件 12288 2018-07-01 15:51 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\bin\Debug\SellCoffee.exe
文件 189 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\bin\Debug\SellCoffee.exe.config
文件 30208 2018-07-01 15:51 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\bin\Debug\SellCoffee.pdb
目录 0 2018-06-21 15:46 售卖咖啡(使用装饰者模式)\SellCoffee\SellCoffee\obj\
............此处省略16个文件信息
- 上一篇:md5sum.exe
- 下一篇:abaqus 混凝土损伤本构仿真论坛
相关资源
- 软件设计模式期末作业
- 设计模式大作业
- 设计模式画图程序
- 工厂方法设计模式
- 软件设计模式_工厂模式
- 组合模式的一个
- 设计模式总结
- 设计模式可复用面向对象软件的基础
- 软件设计模式大作业样例
- 利用装饰模式,实现可以给人搭配不
- 策略模式工厂方法模式观察者模式
- DAO 设计模式经典
- 软件工程设计模式
-
vp9-bitstream_superfr
ame-and-uncompressed-h - Head First设计模式官方源码
- 基于设计模式的画图程序
- UML 农夫果园 小系统 设计模式
- 设计模式期末作业要求5个以上的设计
- 设计模式作业备份_2
- C嵌入式编程设计模式 源代码
- 设计模式计算器的设计
- 设计模式期末大作业 ToFu
- 东北大学设计模式实验3
- Head First 设计模式 源代码完整
- C设计模式视频教程.txt
- 设计模式完整视频
- 设计模式优缺点及应用场景整理
- 设计模式 含代码及讲解
- jdk中设计模式
- 现金贷产品设计模式
评论
共有 条评论