Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

class Person: def __init__(self, name, gender, address, email, phone): self.name = name self.gender = gender self.address = address self.email = email self.phone = phone class

class Person: def __init__(self, name, gender, address, email, phone): self.name = name self.gender = gender self.address = address self.email = email self.phone = phone class Staff(Person): def __init__(self, name, gender, address, email, phone, staff_id, salary): super().__init__(name, gender, address, email, phone) self.staff_id = staff_id self.salary = salary class Doctor(Staff): def __init__(self, name, gender, address, email, phone, staff_id, salary, dept): super().__init__(name, gender, address, email, phone, staff_id, salary) self.dept = dept def calculate_salary(self): return self.salary class Nursing_Staff(Staff): def __init__(self, name, gender, address, email, phone, staff_id, salary, dept): super().__init__(name, gender, address, email, phone, staff_id, salary) self.dept = dept class Ambulance_Staff(Staff): def __init__(self, name, gender, address, email, phone, staff_id, salary): super().__init__(name, gender, address, email, phone, staff_id, salary) class Department_Head_Doctor(Doctor): def __init__(self, name, gender, address, email, phone, staff_id, salary, dept): super().__init__(name, gender, address, email, phone, staff_id, salary, dept) self.department = dept def get_allowance(self): return self.salary * 0.1 class Patient(Person): def __init__(self, name, gender, address, email, phone, room_no, cost): super().__init__(name, gender, address, email, phone) self.room_no = room_no self.cost = cost class Inpatient(Patient): def __init__(self, name, gender, address, email, phone, room_no, cost): super().__init__(name, gender, address, email, phone, room_no, cost) class Outpatient(Patient): def __init__(self, name, gender, address, email, phone): super().__init__(name, gender, address, email, phone, None, None) 

can you give the uml diagram and the relationships according to this code

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

More Books

Students also viewed these Databases questions