Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please write your answers with your explanations. Thank you! There are two parts on here. Given the following code class PersonClass (object) def _init_ _(self,

Please write your answers with your explanations. Thank you!

There are two parts on here.

image text in transcribed

Given the following code class PersonClass (object) def _init_ _(self, name-'", address''): self.name-name self.address- address def str_(self): return "Name: (" . format (self.name) Write only the code requested for the following classes. Define a new child class of PersonClass called Doctor. Write the header ( declaration of the class) 3 Points) Write the initializer for the Doctor class. It should have the same parameters as the PersonClass, plus two additional parameters; specialty a string that should default to General Practitioner"', and salary a float that defaults to 90,000. In the initializer you should call the constructor for PersonClass passing in the correct values and should then set the additional parameters passed. (7 Points)

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

Big Data, Mining, And Analytics Components Of Strategic Decision Making

Authors: Stephan Kudyba

1st Edition

1466568704, 9781466568709

More Books

Students also viewed these Databases questions