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()
{
string str = string.Empty;
str = "order information:" + unitCount+" "+itemName+"item as$"+unitCost+"each,total cost$"+unitCount*unitCost;
Console.WriteLine(str);
// return unitCount * unitCost;
}
}
class Program
{
static void Main(string[] args)
{
order myOrder;
myOrder.itemName = "Mr.Children HOME";
myOrder.unitCount = 100;
myOrder.unitCost = 12.5;
//调用结构函数
myOrder.total();
// Console.WriteLine(myOrder.total());
//Console.WriteLine(myOrder.);
Console.ReadKey();
}
}
}