• Apartment
     
    • Create class called Apartment, which includes fields for rooms (count), floor and location.
      This class has own minor class: Studio(rooms = 1).

    • Class Apartment includes following methods:
      • Constructor, which gets the count of rooms, floor and location.
      • Accessors, which returns the count of rooms, floor and location.
         
    • Create minor class Studio for main class Apartment:
      • Constructor gets only floor and location, because number of rooms is always 1.
      • Method, that calculates price for the aparment (you can make own rule for pricing)
         
  • Back