Example #1
0
 public Laptop(string model, double price, Battery battery, string manufacturer, string processor, int ram, string graphicsCard, string hdd, string screen)
     : this(model, price, battery, manufacturer)
 {
     this.processor = processor;
     this.ram = ram;
     this.graphicsCard = graphicsCard;
     this.hdd = hdd;
     this.screen = screen;
 }
Example #2
0
File: Laptop.cs Project: jechev/OOP
 public Laptop(string model, decimal price, string manufacturer = null, string processor = null, string ram = null,
     string graphicsCard = null, string hdd = null, string screen = null, Battery battery = null)
     : this(model, price)
 {
     this.Manufacturer = manufacturer;
     this.Processor = processor;
     this.Ram = ram;
     this.GraphicsCard = graphicsCard;
     this.Hdd = hdd;
     this.Screen = screen;
     this.Battery = battery;
 }
Example #3
0
 static void Main(string[] args)
 {
     var baterry1=new Battery("Li-ion",12,3000,4.5f);
     var simpleLaptop=new Laptop("Dell XPS L502x",2550.50m);
     Console.WriteLine(simpleLaptop);
     var laptop = new Laptop("Lenovo Yoga 2 Pro", 869.88m, "Lenovo",
         "Intel Core i5-4210U (2-core, 1.70 - 2.70 GHz, 3MB cache)",
         "8 GB", "128GB SSD", "Intel HD Graphics 4400",
         "13.3\" (33.78 cm) – 3200 x 1800 (QHD+), IPS sensor display", baterry1);
     Console.WriteLine(laptop);
     var laptop1 = new Laptop("Dell Lattude", 1567.4366m, battery: baterry1, processor: "i7 3.2 GHz", ram: "16 GB");
     Console.WriteLine(laptop1);
 }
 public Laptop(string model, string manufacturer, string processor,
     string ram, string graphicsCard, string hdd, string screen,
     Battery batteryType, double batteryLife, double price)
 {
     this.Model = model;
     this.Manufacturer = manufacturer;
     this.Processor = processor;
     this.Ram = ram;
     this.GraphicsCard = graphicsCard;
     this.Hdd = hdd;
     this.Screen = screen;
     this.BatteryType = batteryType;
     this.BatteryLife = batteryLife;
     this.Price = price;
 }
Example #5
0
 public Laptop(string model, double price, Battery battery, string manufacturer)
     : this(model, price)
 {
     this.batt = battery;
     this.manufacturer = manufacturer;
 }
Example #6
0
 public void addBattery(Battery battery)
 {
     this.batt = battery;
 }
 public Laptop(string model, decimal price, Battery battery)
 {
     this.Model = model;
     this.Price = price;
     this.Battery = battery;
 }