1. Create an Employee class and do the following: a) Declare the following member variables: Employee Id, Employee Name, and Salary b) Create a default constructor with no parameter. c) Create a parameterized constructor to initialize all the member variables. d) Create a method to display all the member variables. e) Create a method that will compute the Total Salary of the Employee and return it. The method will accept one parameter Bonus of type double. The Total Salary is computed as Salary + Bonus. f) Generate the getters and setters.
1. Create an Employee class and do the following: a) Declare the following member variables: Employee Id, Employee Name, and Salary b) Create a default constructor with no parameter. c) Create a parameterized constructor to initialize all the member variables. d) Create a method to display all the member variables. e) Create a method that will compute the Total Salary of the Employee and return it. The method will accept one parameter Bonus of type double. The Total Salary is computed as Salary + Bonus. f) Generate the getters and setters.
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 1GZ
Related questions
Concept explainers
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Question
basic java only
![3. Create a class Teaching and do the following:
a) The class should inherit the Employee Class.
b) Declare a member variable Teaching hours and Advising hours
c) Create a default constructor with no parameter
d) Create a parameterized constructor that will call the constructor of the parent class
(super class) and then initialize the member variables.
e) Create a method that will return a value to determine the status of the Employee based
on the criteria below:
When Teaching hours is greater than or equal to 18 AND Advising hours is greater
than or equal to 2 then the status of the Employee is "Full Load".
Otherwise the status of the Employee is "Not Full Load"
The method should return the status of the Employee.
h) Create an overriding method to compute and return the Total Salary. The method will
accept parameter Rate of type double. The method will compute and return the value of
Total Salary using the formula:
Total Salary Rate * Teaching Hours
f) Create an overriding method to display all the member variables. The method should
invoke/call the super class display method and then display also all the member
variables of this class.
g) Generate the getters and setters
4. Create a controlling class and do the following:
• Create an object for the two (2) subclasses
Read the input, call the necessary methods, and display the required output.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F998e13cd-d27b-4100-8a88-bbcb88f6af16%2F90877307-3285-48af-b8fe-a59815ec0a1d%2Fjx9l5q_processed.png&w=3840&q=75)
Transcribed Image Text:3. Create a class Teaching and do the following:
a) The class should inherit the Employee Class.
b) Declare a member variable Teaching hours and Advising hours
c) Create a default constructor with no parameter
d) Create a parameterized constructor that will call the constructor of the parent class
(super class) and then initialize the member variables.
e) Create a method that will return a value to determine the status of the Employee based
on the criteria below:
When Teaching hours is greater than or equal to 18 AND Advising hours is greater
than or equal to 2 then the status of the Employee is "Full Load".
Otherwise the status of the Employee is "Not Full Load"
The method should return the status of the Employee.
h) Create an overriding method to compute and return the Total Salary. The method will
accept parameter Rate of type double. The method will compute and return the value of
Total Salary using the formula:
Total Salary Rate * Teaching Hours
f) Create an overriding method to display all the member variables. The method should
invoke/call the super class display method and then display also all the member
variables of this class.
g) Generate the getters and setters
4. Create a controlling class and do the following:
• Create an object for the two (2) subclasses
Read the input, call the necessary methods, and display the required output.
![1. Create an Employee class and do the following:
a) Declare the following member variables: Employee Id, Employee Name, and Salary
b) Create a default constructor with no parameter.
c) Create a parameterized constructor to initialize all the member variables.
d) Create a method to display all the member variables.
e) Create a method that will compute the Total Salary of the Employee and return it. The
method will accept one parameter Bonus of type double.
The Total Salary is computed as Salary + Bonus.
f)
Generate the getters and setters.
2. Create a class Admin and do the following:
a) The class should inherit the Employee Class.
b) Declare a member variable Allowance and Department
c) Create a default constructor with no parameter
d) Create a parameterized constructor that will call the constructor of the parent class
(super class) and then initialize the member variables.
e) Create an overriding method to compute the Total Salary. The method will compute and
return the value of Total Salary using the formula below:
Total Salary = Salary + Allowance
f) Create an overriding method to display all the member variables. The method should
invoke/call the super class display method and then display also all the member
variables of this class.
g) Generate the getters and setters](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F998e13cd-d27b-4100-8a88-bbcb88f6af16%2F90877307-3285-48af-b8fe-a59815ec0a1d%2F83hbewf_processed.png&w=3840&q=75)
Transcribed Image Text:1. Create an Employee class and do the following:
a) Declare the following member variables: Employee Id, Employee Name, and Salary
b) Create a default constructor with no parameter.
c) Create a parameterized constructor to initialize all the member variables.
d) Create a method to display all the member variables.
e) Create a method that will compute the Total Salary of the Employee and return it. The
method will accept one parameter Bonus of type double.
The Total Salary is computed as Salary + Bonus.
f)
Generate the getters and setters.
2. Create a class Admin and do the following:
a) The class should inherit the Employee Class.
b) Declare a member variable Allowance and Department
c) Create a default constructor with no parameter
d) Create a parameterized constructor that will call the constructor of the parent class
(super class) and then initialize the member variables.
e) Create an overriding method to compute the Total Salary. The method will compute and
return the value of Total Salary using the formula below:
Total Salary = Salary + Allowance
f) Create an overriding method to display all the member variables. The method should
invoke/call the super class display method and then display also all the member
variables of this class.
g) Generate the getters and setters
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 5 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,