Esempio n. 1
0
        static void Main()
        {
            float pariVMinuta = 0.37f;

            var gsm = new GSM("S6", "Samsung", "450 marki", "Patkan", new Battery(Battery.BatteryType.NiCd, "Anker", "2", "2"), new Display("720p", "20 000 000"));

            gsm.addCall(new Call("24.02/2016", "17:00", 08888888, 5));
            gsm.addCall(new Call("27.03/2016", "11:00", 08888888, 50));
            gsm.addCall(new Call("29.12/2016", "12:00", 08888888, 15));

            foreach (var calls in gsm.PhoneCallHistory)
            {
                Console.WriteLine(calls.ToString());
            }
            Console.WriteLine("Your smetka is: {0} leva", gsm.calculateCallPrices(pariVMinuta));

            gsm.deleteCall(gsm.PhoneCallHistory.OrderByDescending(x => x.Duration).First());

            Console.WriteLine("Your new smetka is: {0} leva", gsm.calculateCallPrices(pariVMinuta));

            gsm.clearCallHistory();

            foreach (var calls in gsm.PhoneCallHistory)
            {
                //Nqma da se slu4i ni6to ,za6toto e prazno :). Da im imam usloviqta :D
                Console.WriteLine(calls);
            }
        }
Esempio n. 2
0
        // VNIMANIE!! Proekta ima 2 Main class-a. Ako bugva natisnete Problem.GSM -> dqsno kop4e Properties -> StartUp object -> izberete Problem.GSMTest
        static void Main(string[] args)
        {
            List <GSM> gsmHolder = new List <GSM>();

            GSM samsungS4 = new GSM("s6", "samsung");
            GSM samsungS3 = new GSM("s4", "samsung", "500 marki", "Kolio Mamata", new Battery(Battery.BatteryType.LiIon), new Display("500p", "200 hilqdi"));

            gsmHolder.Add(samsungS4);
            gsmHolder.Add(samsungS3);

            Console.WriteLine(GSM.Iphone4.ToString());

            foreach (var gsm in gsmHolder)
            {
                Console.WriteLine(gsm.ToString());
            }
        }