2. • Arial + B I UA 11 田 D ス1三1三 三三 4 3. 6. 3- Create the sub class "Salary Based Employee" that is derived from the super class "Employee" and has the following instance variables, constructor, and methods: a) name b) date_of_birth c) starting_date d) ssn e) phone_number f) salary g) Constructor h) set/get methods i) computeSalary that is based on his/her salary j) print method 4- Create the sub class "Manager Employee" that is derived from the class "Salary_Based_Employee" and has the following instance variables, constructor, and methods: a) name b) date_of_birth c) starting_date d) ssn e) phone_number f) salary g) bonus h) Constructor i) set/get methods j) computeSalary that is based on his/her salary and bonus k) print method MacBook Air

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

write a python code

complete questions 3 and 4 using the following code:


class Employee:
    name = ""
    date_of_birth = "" #string format dd/mm/yyyy
    starting_date = ""
    ssn = 0
    
    #Constructor
    def __init__(self, name, date_of_birth, starting_date, ssn):
        self.name = name
        self.date_of_birth = date_of_birth
        self.starting_date = starting_date
        self.ssn = ssn
    
    #Getter methods
    def getName(self):
        return self.name
    def getDOB(self):
        return self.date_of_birth
    def getStartingDate(self):
        return self.starting_date
    def getSSN(self):
        return self.ssn
        
    #Setter methods
    def setName(self, name):
        self.name = name
    def setDOB(self, date_of_birth):
        self.date_of_birth = date_of_birth
    def setStartingDate(self, starting_date):
        self.starting_date = starting_date
    def setSSN(self):
        self.ssn = ssn
    
    def print(self):
        print("Name: ", self.name)
        print("DOB: ", self.date_of_birth)
        print("Starting date: ", self.starting_date)
        print("SSN: ", self.ssn)

class Hourly_Based_Employee(Employee):
    #Rest data members are dervied from the super class.
    phone_number = 0
    per_Hour = 0
    hours = 0
    
    #Constructor
    def __init__(self, name, date_of_birth, starting_date, ssn, phone_number, per_Hour, hours):
        super().__init__(name, date_of_birth, starting_date, ssn)
        self.phone_number = phone_number
        self.per_Hour = per_Hour
        self.hours = hours
    
    #Getter methods
    def getPhoneNumber(self):
        return self.phone_number
    def getPerHour(self):
        return self.per_Hour
    def getHours(self):
        return self.hours
    
    #Setter methods
    def setPhoneNumber(self, phone_number):
        self.phone_number = phone_number
    def setPerHour(self, per_Hour):
        self.per_Hour = per_Hour
    def setHours(self, hours):
        self.hours = hours
        
    def computeSalary(self):
        return hours*per_Hour

2.
• Arial
+ B I UA
11
田 D
ス1三1三 三三
4
3.
6.
3- Create the sub class "Salary Based Employee" that is derived from the super class
"Employee" and has the following instance variables, constructor, and methods:
a) name
b) date_of_birth
c) starting_date
d) ssn
e) phone_number
f) salary
g) Constructor
h) set/get methods
i) computeSalary that is based on his/her salary
j) print method
4- Create the sub class "Manager Employee" that is derived from the class
"Salary_Based_Employee" and has the following instance variables, constructor, and methods:
a) name
b) date_of_birth
c) starting_date
d) ssn
e) phone_number
f) salary
g) bonus
h) Constructor
i) set/get methods
j) computeSalary that is based on his/her salary and bonus
k) print method
MacBook Air
Transcribed Image Text:2. • Arial + B I UA 11 田 D ス1三1三 三三 4 3. 6. 3- Create the sub class "Salary Based Employee" that is derived from the super class "Employee" and has the following instance variables, constructor, and methods: a) name b) date_of_birth c) starting_date d) ssn e) phone_number f) salary g) Constructor h) set/get methods i) computeSalary that is based on his/her salary j) print method 4- Create the sub class "Manager Employee" that is derived from the class "Salary_Based_Employee" and has the following instance variables, constructor, and methods: a) name b) date_of_birth c) starting_date d) ssn e) phone_number f) salary g) bonus h) Constructor i) set/get methods j) computeSalary that is based on his/her salary and bonus k) print method MacBook Air
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY