using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication13
{
//修改下面的结构,使之包含一个返回订单总价格的的函数.
//struct order
//{
// public string itemName;
// public int unitCount;
// public double unitCost;
//}
struct order
{
public string itemName;
public int unitCount;
public double unitCost;
public double total()
{
return unitCount * unitCost;
}
}
class Program
{
static void Main(string[] args)
{
order myOrder;
myOrder.itemName = "CD";
myOrder.unitCount = 10;
myOrder.unitCost = 50.5;
//调用结构函数
Console.WriteLine(myOrder.total());
//Console.WriteLine(myOrder.);
Console.ReadKey();
}
}
}