public string GetModel(){ return this.model;}
public float GetPrice(){ return this.price;}
public string GetColor(){ return this.color;}
public string GetStatus()
public void SetModel(string newModel) { this.model = newModel;}
public void SetPrice(float newPrice) { this.price = newPrice;}
public void SetColor(string newColor) { this.color = newColor;}
public void SwitchStatus()
public class Fridge : Product
public float consumption;
public int GetDoors(){ return this.doors;}
public float GetConsumption(){ return this.consumption;}
public void SetDoors(int newDoors) { this.doors = newDoors;}
public void SetConsumption(float newConsumption) { this.consumption = newConsumption;}
public void SetNewFridge(string newModel, float newPrice, string newColor, bool newStatus, int newDoors, float newConsumption)
this.consumption = newConsumption;
Console.WriteLine("Modelo: " + this.model);
Console.WriteLine("Precio: $" + this.price + " USD");
Console.WriteLine("Color: " + this.color);
Console.WriteLine("Estado: " + this.GetStatus());
Console.WriteLine("Puertas: " + this.doors);
Console.WriteLine("Consumo: " + this.consumption + " watts");
public class TV : Product
public int GetSize(){ return this.size;}
public void SetSize(int newSize) { this.size = newSize;}
public void SetNewTV(string newModel, float newPrice, string newColor, bool newStatus, int newSize )
Console.WriteLine("Modelo: " + this.model);
Console.WriteLine("Precio: " + this.price);
Console.WriteLine("Color: " + this.color);
Console.WriteLine("Estado: " + this.GetStatus());
Console.WriteLine("Tamaño: " + this.size);
Console.WriteLine("Modelo: ");
string mod = Console.ReadLine();
Console.WriteLine("Precio: ");
float pri = float.Parse(Console.ReadLine());
Console.WriteLine("Color: ");
string col = Console.ReadLine();
Console.WriteLine("Estado: 0: apagado 1:encendido");
int sta = Int32.Parse(Console.ReadLine());
Console.WriteLine("Tamaño: ");
int siz = Int32.Parse(Console.ReadLine());
this.SetNewTV(mod,pri,col,stat,siz);
public static void Main()
TV[] televisores = new TV[3];
for (int i = 0 ; i < televisores.Length; i ++)
televisores[i] = new TV();
televisores[0].SetNewTV("43UK62", 500f, "Gris", false, 43 );
televisores[1].SetNewTV("52UK62", 1000f, "Gris", false, 52 );
contador = contador + 1 ;
for (int i = 0 ; i < televisores.Length; i ++)
televisores[i].ShowData();
Console.WriteLine("--------");
Console.WriteLine("¿Quiere cambiar de encedido/apagado el televisor 1?");
string sta = Console.ReadLine();
televisores[0].SwitchStatus();
televisores[0].ShowData();