static void Main()
 {
     Laptop lenovo = new Laptop("Lenovo Yoga 2 Pro", "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",
         "Li-Ion, 4-cells, 2550 mAh", "4.5 hours", 2259.00);
     Laptop hp = new Laptop("HP 250 G2", 699.00);
     Console.WriteLine(hp);
     Console.WriteLine(lenovo);
 }
        static void Main(string[] args)
        {
            Battery firstBattery = new Battery("Li-Ion, 4-cells, 2550 mAh", 4.5);
            Laptop firstLaptop = new Laptop("Lenovo Yoga 2 Pro", "Lenovo", "Intel Core i5-4210U", 8, "Intel HD Graphics 4400", "128GB SSD", "3200 x 1800, IPS sensor display", firstBattery.ToString(), 2259.00m);
            Laptop secondLaptop = new Laptop("HP 250 G2", 699.00m);

            Console.WriteLine(firstLaptop.ToString());
            Console.WriteLine();
            Console.WriteLine(secondLaptop.ToString());
        }
Exemple #3
0
 static void Main(string[] args)
 {
     Battery battery = new Battery("Li-Ion", 4, 2550);
     Laptop laptop = 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",
         battery,
         4.5,
         2259);
     Laptop asus = new Laptop("Asus", 1599.99m);
     Console.WriteLine(laptop);
     Console.WriteLine(asus);
 }
        static void Main(string[] args)
        {
            var laptopWithFullInfo = new Laptop(
                "Lenovo Yoga 2 Pro",
                2259.00m,
                "Lenovo",
                "13.3 inches (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display)",
                "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
                "8 GB",
                "128GB SSD",
                "Intel HD Graphics 4400",
                new Battery("Li-Ion", 4, 2550, 4.5));

            Console.WriteLine(laptopWithFullInfo);

            var laptopWithMandatoryInfoOnly = new Laptop("HP 250 G2", 699.00m);

            Console.WriteLine(laptopWithMandatoryInfoOnly);
        }