本文整理汇总了C#中GSM.CalculateTotalCallsPrice方法的典型用法代码示例。如果您正苦于以下问题:C# GSM.CalculateTotalCallsPrice方法的具体用法?C# GSM.CalculateTotalCallsPrice怎么用?C# GSM.CalculateTotalCallsPrice使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GSM
的用法示例。
在下文中一共展示了GSM.CalculateTotalCallsPrice方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
try
{
//Create battery and display for the GSM
Battery battery = new Battery("BL-5C",360,7,Battery.BatteryType.LithiumLon);
Display display = new Display(3,65536);
//Create GSM
GSM gsm = new GSM("1208", "nokia", 50, "Georgi", battery, display);
//Console.WriteLine(gsm.ToString()); //Print GSM data
//Mace some calls and print the history
gsm.AddCall(new Call(new DateTime(2013, 02, 22, 19, 01, 22), "00359888888888", 200));
gsm.AddCall(new Call(new DateTime(2013,02,22,20,02,33),"0887888888",302));
gsm.AddCall(new Call(new DateTime(2013, 02, 22, 20, 30, 19), "0889-88-88-88", 178));
gsm.PrintCallHistiry();
//Calculate the price of all calls
decimal price = 0.37m;
gsm.CalculateTotalCallsPrice(price);
//Remove the longest call and calculate the price again
gsm.DeleteCall(1); //The calls in the list start from 0, so the second call(longest) is 1
gsm.CalculateTotalCallsPrice(price);
//Clear the history and print it
gsm.ClearCallHistory();
gsm.PrintCallHistiry();
}
catch (Exception ex)
{
Console.WriteLine("Error!"+ex.Message);
}
}