' ++++++++++++++++++++++++++++ Klasa Apartment ++++++++++++++++++++++++
Public Class Apartment
  Inherits Building

  Private mUnits As Integer    ' Liczba mieszkań
  Private mRent As Double      ' Cena najmu na jednostkę 
  Private mOccupRate As Double ' Współczynnik zajęcia dla budynku 
    
  ' ==================== Właściwości ======================

  Public Property Units() As Integer   ' Liczba mieszkań
    Get
      Return mUnits
    End Get
    Set(ByVal Value As Integer)
      mUnits = Value
    End Set
  End Property

  Public Property Rents() As Double   ' Cena najmu 
    Get
      Return mRent
    End Get
    Set(ByVal Value As Double)
      mRent = Value
    End Set
  End Property

  Public Property OccupancyRate() As Double ' Współczynnik zajęcia
    Get
      Return mOccupRate
    End Get
    Set(ByVal Value As Double)
      mOccupRate = Value
    End Set
  End Property

  ' ============== Metody ==================
    
  Public Sub DisplayBuilding() ' wyświetla dane o budynku

    DisplayBaseInfo()
    Console.WriteLine("Liczba jednostek: " & mUnits)
    Console.WriteLine("Cena wynajmu na jednostkę: " & FormatMoney(mRent))
    Console.WriteLine("Współczynnik zajęcia: " & mOccupRate)
  End Sub

End Class

' ++++++++++++++++++++++++ Klasa Commercial ++++++++++++++++++++++++

Public Class Commercial
  Inherits Building

  Private mSquareFeet As Integer  ' Powierzchnia do wynajęcia w m kw.
  Private mRentPerSF As Double    ' Cena wynajmu za m kw. 
  Private mParking As Integer     ' Miejsca parkingowe

  ' ==================== Właściwości ======================
    
  Public Property SquareFeet() As Integer  ' Metry kwadratowe
    Get
      Return mSquareFeet
    End Get
    Set(ByVal Value As Integer)
      mSquareFeet = Value
    End Set
  End Property

  Public Property RentPerSF() As Double   ' Cena najmu za m kw. 
    Get
      Return mRentPerSF
    End Get
    Set(ByVal Value As Double)
      mRentPerSF = Value
    End Set
  End Property

  Public Property ParkingSpots() As Integer ' Miejsca parkingowe
    Get
      Return mParking
    End Get
    Set(ByVal Value As Integer)
      mParking = Value
    End Set
  End Property

  ' ============== Metody ==================

  Public Sub DisplayBuilding()
    DisplayBaseInfo()        ' Wywołanie klasy bazowej
    Console.WriteLine("Metrów kwadratowych: " & mSquareFeet)
    Console.WriteLine("Cena za m2: " & FormatMoney(mRentPerSF))
    Console.WriteLine("Miejsca parkingowe: " & mParking)
  End Sub
End Class

' ++++++++++++++++++++++++++++ Klasa Home ++++++++++++++++++++++++++++

Public Class Home
  Inherits Building

  Private mSquareFeet As Integer    ' Powierzchnia domu
  Private mRentPerMonth As Double   ' Cena najmu za miesiąc 
  Private mBedrooms As Integer      ' Liczba sypialni
  Private mBaths As Integer         ' Liczba łazienek

  ' ==================== Właściwości ======================
    
  Public Property SquareFeet() As Integer   ' Powierzchnia domu
    Get
      Return mSquareFeet
    End Get
    Set(ByVal Value As Integer)
      mSquareFeet = Value
    End Set
  End Property

  Public Property Rent() As Double      ' Cena najmu
    Get
      Return mRentPerMonth
    End Get
    Set(ByVal Value As Double)
      mRentPerMonth = Value
    End Set
  End Property

  Public Property Bedrooms() As Integer     ' Sypialnie
    Get
      Return mBedrooms
    End Get
    Set(ByVal Value As Integer)
      mBedrooms = Value
    End Set
  End Property

  Public Property Baths() As Integer    ' Łazienki
    Get
      Return mBaths
    End Get
    Set(ByVal Value As Integer)
      mBaths = Value
    End Set
  End Property
  ' ============== Metody ==================
    
  Public Sub DisplayBuilding()

    DisplayBaseInfo()        ' Wywołanie klasy bazowej
    Console.WriteLine("Typ budynku: Dom")
    Console.WriteLine("Powierzchnia w m2: " & mSquareFeet)
    Console.WriteLine("Cena najmu za miesiąc: " & _
                       FormatMoney(mRentPerMonth))
    Console.WriteLine("Sypialnie: " & mBedrooms)
    Console.WriteLine("Łazienki: " & mBaths)
  End Sub

End Class
