黑马程序员技术交流社区
标题:
修改一下结构,使之包含一个返回订单总价格的函数
[打印本页]
作者:
王锋华
时间:
2012-9-15 09:13
标题:
修改一下结构,使之包含一个返回订单总价格的函数
本帖最后由 王锋华 于 2012-9-15 14:52 编辑
struct order
{
public string itemName;
public int unitCount;
public double unitCost;
}
作者:
iamheima
时间:
2012-9-15 10:21
struct Order
{
public string itemName;
public int unitCount;
public double unitCost;
public double returnTotalPrice()
{
return unitCost * unitCount;
}
}
复制代码
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2