当前位置: 首页>>代码示例>>C#>>正文


C# GSM.DisplayCallHistory方法代码示例

本文整理汇总了C#中GSM.DisplayCallHistory方法的典型用法代码示例。如果您正苦于以下问题:C# GSM.DisplayCallHistory方法的具体用法?C# GSM.DisplayCallHistory怎么用?C# GSM.DisplayCallHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GSM的用法示例。


在下文中一共展示了GSM.DisplayCallHistory方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Main

    static void Main()
    {
        // GSMTest
        GSM[] test = new GSM[3];

        Display testDisplay = new Display(12, 13);
        Battery testBattery = new Battery(BatteryType.LiIon, 10, 10);

        GSM firstPhone = new GSM("test", "test", 12, "Bai Ivan", testBattery, testDisplay);
        test[0] = firstPhone;

        GSM secondPhone = new GSM("SecondTest", "SecondTest", 14, "Moore Name", testBattery, testDisplay);
        test[1] = secondPhone;

        GSM thirdPhone = new GSM("Some test", "Texttt", 1, "Name", testBattery, testDisplay);
        test[2] = thirdPhone;

        for (int i = 0; i < test.Length; i++)
        {
            Console.WriteLine(test[i]);
        }

        Console.WriteLine(GSM.Iphone.Model);
        Console.WriteLine(GSM.Iphone.Manufacturer);
        Console.WriteLine(firstPhone.Battery.BatteryModel);

        Console.WriteLine("---------------------------------");
        Console.WriteLine("GSMCallHistoryTest");
        Console.WriteLine("---------------------------------");

        //GSMCallHistoryTest
        GSM myPhone = new GSM("Nokia", "Nokia Corp", 1, "Ivan", testBattery, testDisplay);

        myPhone.AddCall(DateTime.Now, "088888888", 236);
        myPhone.AddCall(DateTime.Now, "077777777", 333);
        myPhone.AddCall(DateTime.Now, "066666666", 123);
        myPhone.AddCall(DateTime.Now, "055555555", 11);
        myPhone.AddCall(DateTime.Now, "044444444", 23);

        myPhone.DisplayCallHistory();

        Console.WriteLine(myPhone.CalcPrice(0.37));

        myPhone.RemoveCallByDuration(333);

        myPhone.DisplayCallHistory();
        Console.WriteLine(myPhone.CalcPrice(0.37));

        myPhone.ClearHistory();
        myPhone.DisplayCallHistory();
    }
开发者ID:emilNikolov,项目名称:MyTelerikProjectsAndHomeworks,代码行数:51,代码来源:GSMTest.cs

示例2: Main

    static void Main()
    {
        //GSM Test
        GSM[] mobilePhoneArray = new GSM[3];

        Display testDisplay = new Display(8, 160);
        Battery testBattery = new Battery(BatteryType.LiIon, 10, 10);

        GSM firstMobile = new GSM("Lumia", "Nokia", 350, "Pesho", testBattery, testDisplay);
        mobilePhoneArray[0] = firstMobile;

        GSM secondMobile = new GSM("One", "HTC", 700, "Toshko", testBattery, testDisplay);
        mobilePhoneArray[1] = secondMobile;

        GSM thirdMobile = new GSM("Galaxy S3", "Samsung", 500, "Ganio", testBattery, testDisplay);
        mobilePhoneArray[2] = secondMobile;

        for (int i = 0; i < mobilePhoneArray.Length; i++)
        {
            Console.WriteLine(mobilePhoneArray[i]);
            Console.WriteLine(new string('=', 17));
            Console.WriteLine();
        }

        Console.WriteLine(GSM.Iphone.Model);
        Console.WriteLine(GSM.Iphone.Manufacturer);
        Console.WriteLine(GSM.Iphone.Price);
        Console.WriteLine();

        //GSM Call History Test
        GSM myPhone = new GSM("Lumia", "Nokia", 459, "Kiro", testBattery, testDisplay);

        myPhone.AddCall(DateTime.Now, "0884647523", 456);
        myPhone.AddCall(DateTime.Now, "0894547579", 320);
        myPhone.AddCall(DateTime.Now, "0875578923", 15);
        myPhone.AddCall(DateTime.Now, "0888987051", 45);
        myPhone.AddCall(DateTime.Now, "0880600700", 32);
        myPhone.AddCall(DateTime.Now, "0875657258", 69);

        myPhone.DisplayCallHistory();

        Console.WriteLine(myPhone.CalcPrice(0.37));

        myPhone.RemoveCallByDuration(456);

        myPhone.DisplayCallHistory();
        Console.WriteLine(myPhone.CalcPrice(0.37));

        myPhone.ClearHistory();
        myPhone.DisplayCallHistory();
    }
开发者ID:Emrace,项目名称:Clockwork-Dynamics,代码行数:51,代码来源:GSMTest.cs

示例3: Main

    static void Main()
    {
        // GSMTest
        GSM[] test = new GSM[3];
        Display testDisplay = new Display(5, 65000);
        Battery testBattery = new Battery(BatteryType.LiIon, 15, 20);

        GSM firstPhone = new GSM("StarII", "Samsung", 120, "Pesho", testBattery, testDisplay);
        test[0] = firstPhone;

        Display test2Display = new Display(3, 250);
        Battery test2Battery = new Battery(BatteryType.NiCd, 10, 12);
        GSM secondPhone = new GSM("Desire 300", "HTC", 300, "Ivan", test2Battery, test2Display);
        test[1] = secondPhone;

        Display test3Display = new Display(7, 255000);
        Battery test3Battery = new Battery(BatteryType.NiMH, 5, 6);
        GSM thirdPhone = new GSM("Lumbia 625", "Nokia", 650, "Kalina", test3Battery, test3Display);
        test[2] = thirdPhone;

        for (int i = 0; i < test.Length; i++)
        {
            Console.WriteLine(test[i]);
        }

        Console.WriteLine(GSM.Iphone.Model);
        Console.WriteLine(GSM.Iphone.Manufacturer);
        Console.WriteLine(firstPhone.Battery.BatteryModel);
        Console.WriteLine(new string('-',70));
        Console.WriteLine("GSM CALL Histiry Test");
        Console.WriteLine(new string('-', 70));

        //GSM Call History Test
        GSM myPhone = new GSM("IPhone4S", "Apple", 450, "Lili", testBattery, testDisplay);

        myPhone.AddCall(DateTime.Now, "0888665533", 55);
        myPhone.AddCall(DateTime.Now, "0888345678", 512);
        myPhone.AddCall(DateTime.Now, "0888123456", 238);
        myPhone.AddCall(DateTime.Now, "0888987654", 5);
        myPhone.AddCall(DateTime.Now, "0888244668", 105);
        myPhone.AddCall(DateTime.Now, "0888133557", 89);
        myPhone.AddCall(DateTime.Now, "0888435465", 72);
        myPhone.DisplayCallHistory();
        Console.WriteLine(myPhone.CalcPrice(0.37));
        myPhone.RemoveCallByDuration(105);
        myPhone.DisplayCallHistory();
        Console.WriteLine(myPhone.CalcPrice(0.37));
        myPhone.ClearHistory();
        myPhone.DisplayCallHistory();
    }
开发者ID:pepakam,项目名称:TelerikAcademy,代码行数:50,代码来源:GSMTest.cs

示例4: Main

    static void Main()
    {
        GSM mobile = new GSM("3310", "Nokia");

        //Add some calls
        mobile.AddCallToHistory(new Call(DateTime.Now.AddDays(3), DateTime.Now.TimeOfDay, "0888123123", 120));
        mobile.AddCallToHistory(new Call(DateTime.Now.AddDays(5), DateTime.Now.TimeOfDay, "0888456456", 35));

        //Display call history and total price
        mobile.DisplayCallHistory();
        Console.WriteLine("Total price: {0:F2}", mobile.CalculateTotalPrice(0.37));
        Console.WriteLine();

        //Remove longest call and display total price again
        mobile.RemoveLongestCall();
        Console.WriteLine("Total price: {0:F2}", mobile.CalculateTotalPrice(0.37));
        Console.WriteLine();

        //Clear call history and print it
        mobile.ClearCallHistory();
        mobile.DisplayCallHistory();
    }
开发者ID:vanndann,项目名称:TelerikAcademy,代码行数:22,代码来源:GSMCallHistoryTest.cs

示例5: Main

 static void Main()
 {
     //GSMTest Display the information about the GSMs in the array.
     GSM[] myGSMs = new GSM[5];
     GSM phone;
     for (int i = 0; i < myGSMs.Length; i++)
     {
         phone = new GSM("model "+i,"manufact");
         myGSMs[i]=phone;
         Console.WriteLine(myGSMs[i].ToString());
     }
     //Display the information about the static property IPhone4S
     GSM.iPhone4s.ToString();
     //Add few calls.
     phone = new GSM("jhgfhjg540", "manufact");
     Random rand = new Random();
     int phoneForDelete=0;
     for (int i = 0; i < 5; i++)
     {
         phone.AddCall(DateTime.Now, rand.Next(100000, 9999999).ToString(), rand.Next(1, 250));
         if (i==2)
         {
             phoneForDelete=rand.Next(100000, 9999999);
             phone.AddCall(DateTime.Now, phoneForDelete.ToString(), rand.Next(1, 250));
             i++;
         }
     }
     //Display the information about the calls.
     phone.DisplayCallHistory();
     //Assuming that the price per minute is 0.37 calculate and print the total price of the calls in the history.
     Console.WriteLine("Price: "+phone.CalcPrice(0.37));
     //Remove the longest call from the history and calculate the total price again.
     phone.DeleteCall(phoneForDelete.ToString());
     phone.DisplayCallHistory();
     //Finally clear the call history and print it
     phone.ClearHistory();
     phone.DisplayCallHistory();
 }
开发者ID:kancho-kanchev,项目名称:Telerik,代码行数:38,代码来源:01_12_MobilePhone.cs


注:本文中的GSM.DisplayCallHistory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。