Question: Q1. This programme is to demonstrate the use of object orientation using 3 classes. - Create Employee class with a non-static String array firstarray that

Q1. This programme is to demonstrate the use of object orientation using 3 classes. - Create Employee class with a non-static String array firstarray that will store employeename, employeemaritalstatus, and an int array secondarray that will store emoplyeenumber, and employeegrosssalary. Employee class contains the main() method. - Create a HumanResources class. The class contains a non-static SalaryCalculator() method. - Create a Tax class. The class contains a non-static method TotalTax(). Now do as follows: 1. Create an object of Employee class in the main() and with the reference of that object populate the string and int arrays with appropriate values. 2. From main() method of Employee class call SalaryCalculator() method with the reference of the the object. Pass firstarray and secondarray as parameters to the SalaryCalculator(). 3. From SalaryCalculator() method, call TotalTax() method of the Tax class. In the parameters of the call, pass employeegrosssalary and employeemaritalstatus to the TotalTax() method. 4. The TotalTax() will return the approriate taxpercentage back to the SalaryCalculator() method. The tax percentage will be calculated based on the following table: Note: The values in dollars are gross salaries. 5. After receiving the taxpercentage the SalaryCalculator() method calculates the employeenetsalary. The employeenetsalary is employeegrosssalary minus percentagetax. 6. Once the netsalary has been calculated, create a new int array and store the employeenumber and employeenetsalary in it and return it to main(). 7. Display the employeenumber, and employee salary in the main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
