Question

[26] Write a sub class called patient for the following class with accessors and mutators for property called name. Introdu(python)

0 0
Add a comment Improve this question Transcribed image text
Answer #1
class person:
    def __init__(self):
        self.name = ''


class patient(person):
    def __init__(self, sickness):
        self.name = ''
        self.__sickness = sickness

    def get_sickness(self):
        return self.__sickness

    def set_sickness(self, sickness):
        self.__sickness = sickness
Add a comment
Know the answer?
Add Answer to:
(python) [26] Write a sub class called "patient" for the following class with accessors and mutators...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Using Python, Write a class called Plant that has variables height, sunlight, and water, and has...

    Using Python, Write a class called Plant that has variables height, sunlight, and water, and has getters and setters for these variables and a function called Grow, which multiplies sunlight and water together and adds it to height

  • Use python to create this program. 1) Employee Class Write an Employee class that keeps data...

    Use python to create this program. 1) Employee Class Write an Employee class that keeps data attributes for the following pieces of information: Note: For all classes, the attributes must be hidden Employee Name Employee Number Hire Date Create accessors and mutators Attributes should be hidden. Create a class attribute that determines a standard pay rate adjustment 4% for raises 2) ProductionWorker Class Write a class named ProductionWorker that is a subclass of Employee that holds the following attributes .Shift...

  • Write code to create a Java class called "Student". The class should hold information about a...

    Write code to create a Java class called "Student". The class should hold information about a student: name, id and whether or not the student is currently registered. There should be a constructor that takes name, id and registration status. Add getters and setters for the three properties. Make sure that you use appropriate visibility modifiers (public vs. private).

  • can you please solve #2, 3 and 4 ? please by using Python 3 8:34 PM...

    can you please solve #2, 3 and 4 ? please by using Python 3 8:34 PM € Assignment Details 6202-COSC-2436-Programming Fundamentals i company TOITOWS: Ask the customer have his into G unter his own . If you SOLO u ld email. If Ask hinto anto TV unit l emname, .). Append the total Hoe to his 2. Create a class called person with name, phone and email as private attributes. Create a customer class as a sub class of person...

  • reate a class called Person with the following attributes: name - A string representing the person's...

    reate a class called Person with the following attributes: name - A string representing the person's name age - An int representing the person's age in years As well as appropriate __init__ and __str__ methods, include the following methods: get_name(self) - returns the name of the person get_age(self) - returns the age of the person set_name(self, new_name) - sets the name for the person set_age(self, new_age) - sets the age for the person is_older_than(self, other) - returns True if this...

  • Design and implement a C++ class called Date that has the following private member variables month...

    Design and implement a C++ class called Date that has the following private member variables month (int) day (nt) . year (int Add the following public member functions to the class. Default Constructor with all default parameters: The constructors should use the values of the month, day, and year arguments passed by the client program to set the month, day, and year member variables. The constructor should check if the values of the parameters are valid (that is day is...

  • 9p This is for Python I need help. Pet #pet.py mName mAge class Pet: + __init__(name,...

    9p This is for Python I need help. Pet #pet.py mName mAge class Pet: + __init__(name, age) + getName + getAge0 def init (self, name, age): self.mName = name self.mAge = age Dog Cat def getName(self): return self.mName mSize mColor + __init__(name, age,size) + getSize() + momCommento + getDog Years() +_init__(name, age,color) + getColor + pretty Factor + getCatYears def getAge(self): return self.mAge #dog.py import pet #cat.py import pet class Dog (pet. Pet): class Cat (pet. Pet): def init (self,...

  • Write a class called Book that has two private member variables called page (integer) and topic...

    Write a class called Book that has two private member variables called page (integer) and topic (string). It also has a static private member variable called count (integer). This class has only one constructor with default argument for page and topic. Write this constructor. Also overload the addition operator for this class such that it will add an integer value to the page variable of the book. For example when in main we say: book2 = book1 + 4; then...

  • Write a program that does the following in Python Code: Write a new Class called Famous_Day_Born which is a subclass of Famous_Person. Add a method to calculate the day of the week the person was born...

    Write a program that does the following in Python Code: Write a new Class called Famous_Day_Born which is a subclass of Famous_Person. Add a method to calculate the day of the week the person was born and print out all of the corresponding information using the overridden print method. Use the following code below as a starting point. ////////////////////////////////////////////////////// from datetime import datetime class Famous_Person(object): def __init__(self, last, first, month,day, year): self.last = last self.first = first self.month = month...

  • 1. Extending the answer from Python HW #7 for question #1, write the following python code...

    1. Extending the answer from Python HW #7 for question #1, write the following python code to expand on the Car class. Include the python code you developed when answering HW #7. Add class “getter” methods to return the values for model, color, and MPG Add class “setter” methods to change the existing values for model, color, and MPG. The value to be used in the methods will be passed as an input argument. Add class method that will calculate...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT