Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python Given the following class hierarchy, where an Apartment House and a House are specializations (sub-types) of a Building: Building Apartment House House Knowing that:

python
image text in transcribed
Given the following class hierarchy, where an Apartment House and a House are specializations (sub-types) of a Building: Building Apartment House House Knowing that: 1. all buildings have an address a string) 2. all buildings have a resale price (a number) 3. the apartment houses have a number of apartments (a number) 4. the houses have a swimming pool or not (a boolean) 5. all buildings are taxed by their city as follows: the tax amount for an apartment house is equal to the resale price divided by the number of apartments. (resale price / a number of apartments) the tax amount for a house is calculated as the resale price divided by 100, plus $100 for houses having a swimming pool. (resale price/100)+ 100 (a) Write these three classes in Python including the constructors and the methods that are necessary to calculate the tax amount to be paid for a building b) write a main function that: prompts the user to enter the number of buildings in the city for each building, prompts the user the enter building type, the address, the resale price and the number of appartements (for apartment buildings) or whether or not it has a swimming pool (for houses) calculate the total amount of the taxes that these buildings will have to pay

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions