示例#1
0
        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());
        }
 public Laptop(string model, decimal price, string manufacturer, string screen, string processor, string ram, string hdd,
     string graphicsCard, Battery laptopBattery)
 {
     this.Model = model;
     this.Price = price;
     this.Manufacturer = manufacturer;
     this.Screen = screen;
     this.Processor = processor;
     this.RAM = ram;
     this.HDD = hdd;
     this.GraphicsCard = graphicsCard;
     this.LaptopBattery = laptopBattery;
 }
示例#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);
 }
示例#4
0
 public Laptop(
     string model,
     string manufacturer,
     string processor,
     int ram,
     string graphicsCard,
     string hdd,
     string screen,
     Battery battery,
     double batteryLife,
     decimal price)
 {
     this.Model = model;
     this.Manufacturer = manufacturer;
     this.Processor = processor;
     this.Ram = ram;
     this.GraphicsCard = graphicsCard;
     this.Hdd = hdd;
     this.Screen = screen;
     this.Battery = battery;
     this.BatteryLife = batteryLife;
     this.Price = price;
 }
示例#5
0
 public Laptop(string model, string processor, string screen, Battery battery, decimal price )
     : this(model, null, processor, 0, null, null, screen, battery, 0, price)
 {
 }