Question: Create a class named Employee with private name and a salary data fields, a toString method to print the data, and get and set methods

Create a class named Employee with private name and a salary data fields, a toString method to print the data, and get and set methods for the two private data items. Create another class named Manager with a field named department that inherits from the Employee class. Include a toString() method that prints the managers name, department, and salary. Create a third class named Director that inherits from the Manager class and has a field named stipendAmount. Supply the toString() method for Director that prints all of its instance variables. Also, write a main program named myOutput that instantiates separate objects using each of the classes and invokes the toString() method to print out each of its instance variables. (15 points) 4. Add overloaded constructors to the Employee and Manager classes where you to pass the name and salary using the Employee constructor and pass the name, salary, and department to the Manager constructor. Write a test class to instantiate a manager object and display its contents. (15 points)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!