using System.Collections.Generic;
public string Location {get;set;}
public int Price {get;set;}
public string ConstructionType {get;set;}
public Asset(string location, int price, string constructiontype)
ConstructionType = constructiontype;
public virtual void PrintData()
Console.WriteLine("Location: " + Location + "; Type: " + ConstructionType);
public int NumberOfBedrooms {get;set;}
public Apartment(string location, int price, string constructiontype, int numberofbedrooms) : base (location, price, constructiontype)
NumberOfBedrooms = numberofbedrooms;
public override void PrintData()
Console.WriteLine("Location: " + Location + "; Type: " + ConstructionType + "; Number of rooms: " + NumberOfBedrooms);
public int NumberOfFloors {get;set;}
public Warehouse(string location, int price, string constructiontype, int numberoffloors) : base (location, price, constructiontype)
NumberOfFloors = numberoffloors;
public override void PrintData()
Console.WriteLine("Location: " + Location + "; Type: " + ConstructionType + "; Number of fllors: " + NumberOfFloors);
public static void Main(string[] args)
Asset myAsset = new Asset("Maia", 300000, "Not Defined");
Asset myApartment = new Apartment("Porto", 125000, "Apartment", 2);
Asset myWarehouse = new Warehouse("Gaia", 50000, "WareHouse", 1);
var myAssets = new List<Asset>(){myAsset, myApartment, myWarehouse};
static void GetLocations(List<Asset> myList)
foreach(var asset in myList)