static void Main()
 {
     Laptop temp1 = new Laptop("Lenovo Yoga 2 Pro", "Lenovo", "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
         8, "Intel HD Graphics 4400", "128GB SSD", "13.3\" (33.78 cm) – 3200 x 1800(QHD +), IPS sensor display",
         new Battery("Li-Ion, 4-cells, 2550 mAh", 4.5), 699.00m);
     Laptop temp2 = new Laptop("HP", 899.99m);
     Console.WriteLine(temp1);
     Console.WriteLine(temp2);
 }
 static void Main()
 {
     Laptop firstLap = new Laptop("Lenovo Yoga 2 Pro", (decimal)2259.00);
     Battery lion = new Battery("Li-Ion, 4-cells, 2550 mAh");
     Battery nicd = new Battery("Ni-Cd", (float)4.5);
     Console.WriteLine(firstLap.ToString());
     Console.WriteLine();
     Laptop secondLap = new Laptop("Lenovo yoga", (decimal)2321, "Lenovo", "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)", "8 GB", "Intel HD Graphics 4400", "128GB SSD", "13.3\" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display", nicd);
     Console.WriteLine(secondLap.ToString());
     
     
 }
Esempio n. 3
0
        static void Main(string[] args)
        {
            try
            {
                var pc1 = new Laptop("Toshiba", 3422);
                Console.WriteLine(pc1.ToString());

                var pc2 = new Laptop("Lenovo", -2400, "Intel", 8);
                Console.WriteLine(pc2.ToString());
            }
            catch(ArgumentException e)
            {
                Console.WriteLine(e.Message);
            }
        }
 static void Main()
 {
     Laptop firstLaptop = new Laptop("Asus", 1000m);
     Laptop secondLaptop = new Laptop("HP", 1500m, new Battery());
     firstLaptop.Processor = "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)";
     firstLaptop.Ram = 8;
     firstLaptop.GraphicsCard = "Intel HD Graphics 4400";
     firstLaptop.Hdd = 128;
     firstLaptop.Screen = @"13.3"" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display";
     secondLaptop.Processor = "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)";
     secondLaptop.Ram = 8;
     secondLaptop.GraphicsCard = "Intel HD Graphics 4400";
     secondLaptop.Screen = @"13.3"" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display";
     secondLaptop.Batt = new Battery("Penka", 3.5);
     Console.WriteLine(firstLaptop);
     Console.WriteLine(secondLaptop);
 }
        static void Main(string[] args)
        {
            Laptop myLaptop = new Laptop("Lenova Yoga 2 Pro", 2259.00M, "Lenovo", "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache", 8, "Intel HD Graphics 4400", "128GB SSD", "13.3\" (33.78cm) - 3200x1800 (QHD+), IPS sensor display", new Battery("Li-Ion, 4-cells,2550 mAh", 4.5));
            Laptop otherLaptop = new Laptop("HP 250 G2", 699.00M);
            Laptop yetOtherLaptop = new Laptop("Acer Aspire 5750G", 1499.00M);

            yetOtherLaptop.GraphicCard = "GeForce 550M";
            yetOtherLaptop.Ram = 8;
            yetOtherLaptop.Hdd = "128GB SSD";

            Console.WriteLine("Sample laptop description (full)");
            Console.WriteLine(myLaptop);
            Console.WriteLine();
            Console.WriteLine("Sample laptop description mandatory properties only");
            Console.WriteLine(otherLaptop);
            Console.WriteLine("My persoanl laptop");
            Console.WriteLine(yetOtherLaptop);
        }
        static void Main(string[] args)
        {
            Laptop lenovo = new Laptop(
                "Lenovo Yoga 2 Pro",
                "Lenovo",
                "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
                8,
                "Intel HD Graphics 4400", "128GB SSD", "13.3\" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display",
                new Battery("Li Ion", 4, 3500), 4.5, 2259.00m);

            // string model, string processor, int ram, string hdd, decimal price
            Laptop toshiba = new Laptop("Lenovo Yoga 2 Pro",
                                        "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
                                        -8,
                                        "128GB SSD",
                                        600.00m);

            Console.WriteLine(lenovo);
            Console.WriteLine("------------------------------------------------");
            Console.WriteLine(toshiba);
        }
Esempio n. 7
0
        static void Main()
        {
            Battery toshiba = new Battery("qkoShiba", 4.5m);
            Laptop shtaiga = new Laptop
                (
                "Lenovo Yoga 2 Pro", "Lenovo", "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
                8, "Intel HD Graphics 4400", "128GB SSD", "13.3\" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display",
                toshiba, 2259.00m
                );
            Laptop model = new Laptop("Ebanie", 200.00m);
            Laptop fourPar = new Laptop("4-ka pravec", "pravec procesor", "zdrav hard", 400.00m);
            Laptop sevenPar = new Laptop("7-ca pravec", "made in bulgaria", "pravec procesor", 4, "mnoo zdrav hard", "ekran ta drynka", 700.00m);

            Console.WriteLine("Shtaiga -> all");
            Console.WriteLine(shtaiga.ToString());
            Console.WriteLine("Ebanie -> Model & Price");
            Console.WriteLine(model.ToString());
            Console.WriteLine("4-ka pravec -> 4 par");
            Console.WriteLine(fourPar.ToString());
            Console.WriteLine("sedmak pravec -> 7 par");
            Console.WriteLine(sevenPar.ToString());
        }
        static void Main(string[] args)
        {
            string  model        = "Lenovo 2 Yoga Pro";
            string  manufacturer = "Lenovo";
            string  processor    = "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)";
            int     RAM          = 8;
            string  GPU          = "Intel HD Graphics 4400";
            string  HDD          = "128GB SSD";
            string  screen       = "13.3\" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display";
            Battery battery      = new Battery("Li-Ion, 4-cells, 2550 mAh");
            decimal price        = -1;

            try
            {
                Laptop laptopka = new Laptop(model, price, manufacturer, processor, RAM, GPU, HDD, screen, battery);
                Console.WriteLine(laptopka.ToString());
            }
            catch (ArgumentException e)
            {
                Console.WriteLine(e.Message);
            }
        }
Esempio n. 9
0
        static void Main()
        {
            Battery toshiba = new Battery("qkoShiba", 4.5m);
            Laptop  shtaiga = new Laptop
                              (
                "Lenovo Yoga 2 Pro", "Lenovo", "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
                8, "Intel HD Graphics 4400", "128GB SSD", "13.3\" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display",
                toshiba, 2259.00m
                              );
            Laptop model    = new Laptop("Ebanie", 200.00m);
            Laptop fourPar  = new Laptop("4-ka pravec", "pravec procesor", "zdrav hard", 400.00m);
            Laptop sevenPar = new Laptop("7-ca pravec", "made in bulgaria", "pravec procesor", 4, "mnoo zdrav hard", "ekran ta drynka", 700.00m);


            Console.WriteLine("Shtaiga -> all");
            Console.WriteLine(shtaiga.ToString());
            Console.WriteLine("Ebanie -> Model & Price");
            Console.WriteLine(model.ToString());
            Console.WriteLine("4-ka pravec -> 4 par");
            Console.WriteLine(fourPar.ToString());
            Console.WriteLine("sedmak pravec -> 7 par");
            Console.WriteLine(sevenPar.ToString());
        }