Example #1
0
        static void Main()
        {
            var mobileList = new List<GSM>();

            Battery nokiaBattery = new Battery("BJ51", 40, 12, BatteryType.LiIon);
            Battery sonyBattery = new Battery("BA900", 30, 15, BatteryType.NiCd);
            Battery samsungBattery = new Battery("EB-L1G6LLA", 30, 15, BatteryType.NiMH);

            Display smallDisplay = new Display(5, 16000000);
            Display mediumDisplay = new Display(7, 16000000);
            Display bigDisplay = new Display(11, 16000000);

            GSM nokiaLumia = new GSM("Lumia630", "Nokia", 300.00, "Microsoft", nokiaBattery, smallDisplay);
            mobileList.Add(nokiaLumia);
            GSM sonyExperia = new GSM("XperiaM", "Sony", 350.00, "Sony", sonyBattery, mediumDisplay);
            mobileList.Add(sonyExperia);
            GSM samsungNote = new GSM("GalaxyNote", "Samsung", 600.00, "Samsung", samsungBattery, bigDisplay);
            mobileList.Add(samsungNote);

            foreach (var phone in mobileList)
            {
                Console.WriteLine(phone.ToString());
            }
            Console.WriteLine(GSM.GetIPhone());
        }
Example #2
0
        static void Main(string[] args)
        {
            Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;
            GSM Nokia=new GSM("Nokia","NN",250, "Gogo", new Battery("82L", 12,10, BatteryType.LiIon), new Display(20,64));
            GSM HTC = new GSM("HTC", "NK", 130, "Na", new Battery("K9092", 26, 9, BatteryType.NiCd), new Display(10, 128));
            GSM Motorolla = new GSM("Motorolla", "NKH", 10, "Na", new Battery("L92", 13, 3, BatteryType.NiMH), new Display(12, 1024));

            GSM[] gsms=new GSM[]{Nokia, HTC, Motorolla};
            foreach (GSM phone in gsms)
            {
                Console.WriteLine(phone.ToString());
                Console.WriteLine();
            }
            Console.WriteLine(GSM.IPhone4s);
        }
        static void Main()
        {
            GSM[] gsmArr = new GSM[3]
            {
            new GSM("Lumia ", " Nokia ", 850, " Pesho"),
            new GSM("Lumia925 ", " Nokia ", 450, " Gosho"),
            new GSM("3310 ", " Nokia ", 50, " Ivan"),
            };

            foreach (GSM item in gsmArr)
            {
                Console.WriteLine(item.ToString());
            }
            Console.WriteLine();
            Console.WriteLine("Apple phone: ");
            Console.WriteLine(GSM.IPhone4S);
        }
Example #4
0
 static GSM()
 {
     iPhone = new GSM("iPhone 4S", "Apple", 1000, "Will Smith",
         new Battery("Apple", 12, 36, BatteryType.LiIon), new Display(7, 16000000));
 }