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

please write the code using python language. please write the code using python language. Define a class named Villa

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!