Must be completed in python. Please provide correct spacing and indentation as well as all necessary imports
Fantastic news! We've Found the answer you've been seeking!
Question:
Must be completed in python. Please provide correct spacing and indentation as well as all necessary imports
Transcribed Image Text:
Dwelling Variables Functions typeOfDwelling printData() get_dwellingType() str_() value rooms House Variables Functions address printData() str_() numofFloors Apartment Variables Functions address printData() str_() apartmentNumber House and Apartment should inherit from the Dwelling class and implement their own init method that calls said class on creation. Each printData() method should be overridden to include the class' respective variables (ie, the House class should also print out the address and numOfFloors) Each_str_ () method should be overridden to return (not print) the data as a formatted string when the object is called as a string get_dwellingType() should return the type of dwelling (house/apartment) Create two objects, one of type House and one of type Apartment. Call all of their functions Housinglnheritance.py 100% Output Result: House use print(house.get_dwellingType() Dwelling Type:House use house.printData() Value:800 Rooms:100 Address:1911 Simcoe St NumberOffloors:4 Dwelling Type:House use print(house) Value:800 Rooms:100 Address:1911 Simcoe St NumberOffloors:4 Apartment use print(apartment.get_dwellingType()) Dwelling Type:Apartment use apartment.printData() Value:500 Rooms:1 Address:100 York St ApartmentNumber:3087 Dwelling Type:Apartment use print(apartment) Value:500 Rooms:1 Address:100 York St ApartmentNumber:3087 Dwelling Variables Functions typeOfDwelling printData() get_dwellingType() str_() value rooms House Variables Functions address printData() str_() numofFloors Apartment Variables Functions address printData() str_() apartmentNumber House and Apartment should inherit from the Dwelling class and implement their own init method that calls said class on creation. Each printData() method should be overridden to include the class' respective variables (ie, the House class should also print out the address and numOfFloors) Each_str_ () method should be overridden to return (not print) the data as a formatted string when the object is called as a string get_dwellingType() should return the type of dwelling (house/apartment) Create two objects, one of type House and one of type Apartment. Call all of their functions Housinglnheritance.py 100% Output Result: House use print(house.get_dwellingType() Dwelling Type:House use house.printData() Value:800 Rooms:100 Address:1911 Simcoe St NumberOffloors:4 Dwelling Type:House use print(house) Value:800 Rooms:100 Address:1911 Simcoe St NumberOffloors:4 Apartment use print(apartment.get_dwellingType()) Dwelling Type:Apartment use apartment.printData() Value:500 Rooms:1 Address:100 York St ApartmentNumber:3087 Dwelling Type:Apartment use print(apartment) Value:500 Rooms:1 Address:100 York St ApartmentNumber:3087
Expert Answer:
Related Book For
Managerial Decision Modeling with Spreadsheets
ISBN: 978-0136115830
3rd edition
Authors: Nagraj Balakrishnan, Barry Render, Jr. Ralph M. Stair
Posted Date:
Students also viewed these programming questions
-
please show me er diagram as well as explain it between room and customer there will be many to many cardinality ratio please convert it into one to many .also show the entity hotel have staff and...
-
In all states, the prosecution must provide the defense with exculpatory evidence. The exact rules are different state by state, but there is a general rule in all jurisdictions that exculpatory...
-
Please discuss any special accounting treatments necessary to be aware of when disposing of part or all of an investment in a subsidiary, particularly address whether there are any affects of...
-
Classify each of the following random variables as either continuous or discrete: a. The survival time of a cancer patient after receiving a new treatment for cancer b. The number of ticks found on a...
-
Give the iid samples X 1 ,X 2 , . . . of X, define the sequence Y 1 ,Y 2 , . . .by Note that each Y k is an example of Vʹ 2 , an estimate of the variance of X using two samples, given in...
-
What measures can you take to control access to the master production schedule so that only authorized customers may enter their data?
-
Washington Tennis & Education Foundation, Inc. (WTEF) is a nonprofit organization operating in the District of Columbia that provides athletic and academic programs for children from low-income...
-
Logan Krause started her own consulting firm, Krause Consulting, on May 1, 2017. The trial balance at May 31 is as follows. In addition to those accounts listed on the trial balance, the chart of...
-
-. Use the Average Annual Costs of Owning and Operating a Car table below. If you drive 40,000 miles per year, what is the total annual expense for an electric car? (2 points) Average Annual Costs of...
-
Aztec Corporation purchased 70% of the outstanding shares of Inca Limited on January 1, 20X2, at a cost of $84,000. Aztec has always used the cost method to account for its investments. On January 1,...
-
You are the loan department supervisor for a bank. This installment loan is being paid off early, and it is your task to calculate the rebate fraction, the finance charge rebate (in $), and the...
-
Consider a gas turbine which has : 1 Intercooling stage and 2 Reheating stage with and without regenerator (100% effectiveness), 2 Intercooling stage and 1 Reheating stage with and without...
-
A horizontal nozzle has an inlet velocity v and an outlet velocity v2 and discharges into the atmosphere. Show that the outlet velocity can be expressed by the following formulae: V2 v = 22 2 2gAh +...
-
I) II) Many damped physical systems found in engineering may have their behaviour expressed by second-order non-homogeneous ordinary differential equations (ODEs.) This type of problem involves...
-
The pin-jointed truss shown below is supported at D and vertically roller-supported at G. Three weights are applied (at E, F and H). D A E 2m 2m B The tension in EB is The tension in CH is LL F W 2m...
-
Z Water with the density of 1000 kg/m and dynamic viscosity of 1003-10-6 kg/ms is flowing in a narrow pipe (d = 5 mm). The average flow velocity is 0.4 m/s. () (a) Calculate the Reynolds number. (1...
-
In a scientific study, a population of 100 cats that were vaccinated against rabies were taken. Of the cats vaccinated in the scientific study, 5 acquired the disease. Suppose a pet store has 15 cats...
-
Using Apple, demonstrate how the differentiation strategy can be well implemented.
-
A Website has a fixed cost $15,000 per day. The revenue is $0.06 each time the Website is accessed. The variable cost of responding to each hit is $0.02. (a) How many times must this Website be...
-
Fred Ridgeways project (see Problem 7-25) has progressed over the past several months, and it is now the end of month 16. Fred would like to know the current status of the project with regard to...
-
What is a queuing problem? What are the components in a queuing system?
-
In the section of his 2007 letter to the shareholders of Berkshire Hathaway titled Fanciful FiguresHow Public Companies Juice Earnings, Warren Buffett referred to the investment return assumption...
-
Based on 2012 revenues, the six largest providers of oilfield services are: 1. Schlumberger Ltd. (NYSE: SLB) Revenues: $42.1 billion Net income: $5.5 billion 2. Halliburton (NYSE: HAL) Revenues:...
-
On 21 September 2000, Intel Corporation (NASDAQ -GS: INTC)3 issued a press release containing information about its expected revenue growth for the third quarter of 2000. The announced growth fell...
Study smarter with the SolutionInn App