For the class definition of Property, below, write the code…
For the class definition of Property, below, write the code needed to create a subclass called House that inherits everything from Property and adds its own attributes for ‘owner’, ‘estValue’, ‘noBRs’, and propTax’. ‘owner’ is a string, ‘estValue’, noBR’s, and propTax are integers. Protect the attributes from direct access or modification by code outside the class. Include a method ‘chgTax’ that has two integer parameters: newTax and maxInc. maxInc is the maximum percentage that the propTax can be increased (e.g. 5, 10, 15, etc.). First, the chgTax method validates that the newTax parameter is an integer and is no more than 50,000. It also checks that newTax is at most the current propTax plus the maxInc percentage. If either is not true it returns False. Otherwise, it resets ‘propTax’ to the newTax amount and returns True. The solution should be approximately 12 lines of code. Do not retype the Property class definition in your answer. class Property (object): def __init__(self, propID, loc, size, descr): self.__propID = propID self.__loc = loc self.__size = size self.__descr = descr
Read Details