Question: please write the code using python language. Define a class named Villa containing: - Two instance variables named squareMeters and squareMeterCost of type integer and
Define a class named Villa containing: - Two instance variables named squareMeters and squareMeterCost of type integer and double respectively. - A full parameterized constructor which initializes the instance variables. - A method named Price which returns double and also prints a message as "Villa's price is undefined". Define another class named ClassicVilla which is extended from class Villa containing: - A two parameter constructor which initializes all the instance variables of its super class (by calling its constructor). - An overridden method named Price which returns the price of classic villa: (squareMeters * squareMeterCost). Define another class named LuxuryVilla which is extended from class Villa containing: - A two parameter constructor which initializes all the instance variables of its super class (by calling its constructor). - An overridden method named Price which returns the price of luxury villa: (squareMeters * squareMeterCost) 1.5) - Test the functionality of the above classes and print the price of each object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
