Question: java Assignment 12 - 2D Arrays: Polymorphism 1) A company wants to create a group of classes to represent its staff members. Staff members include
Assignment 12 - 2D Arrays: Polymorphism 1) A company wants to create a group of classes to represent its staff members. Staff members include both employees and volunteers. a. Create an abstract class, StaffMember, to model the common attributes and methods of all classes representing staff members. Each staff member has 1. attributes name, phone, and address of String type. 2. an abstract method, pay, that calculates the pay due to the employee. 3. a concrete method, displayProfile, that will display all information about the staff member with appropriate labels. b. A class Volunteer represents a person who does not receive any pay. The pay method for a volunteer returns O as volunteers are not paid. c. A class Employee represents company employees. The company's employees are assigned employee ids and have a salary. The pay method of the Employee class returns the salary of the employee d. A class Manager extends the Employee class. Managers are paid bonuses. Create a method, awardBonus, to set the bonus for Manager. A manager's pay is the sum of the salary and the bonus. e. Write an application, Staff, where you create a 2D-Array of staff members as shown by the table below. Traverse the array and call the method displayProfile to print all information about the staff including the pay of each employee. As the pay for volunteers is o, the application will print "Thank you for volunteers. Employee Name Phone Salary Employee ID Bonus Type Jood 877 1515 Volunteer Dana 877 2525 Raghad 877 3535 Sara 787 1212 SR3000 11111 Address 25 Nofud St Dhahran 101 High St Dammam 15 Kings Rd Khobar 101 High St Dammam 25 Nofud St Dhahran 15 Kings Rd Khobar 15 Kings Rd Khobar 101 High St Dammam 25 Nofud St Dhahran Employee Alaa SR3500 22222 787 2222 7873232 Anas SR3800 33333 Fatimah 834 3567 SR7000 44444 Manager Nourah 834 3568 SR7500 55555 3% of Salary 2.5% of Salary 2.5% of Salary Yousef 834 3569 SR7800 66666
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
