Instructions: (This is the same asmt we did in class, the only difference is that the data file does not tell us how many employees we have. You need to figure out how to handle this situation. However, you may assume the number of employee will never exceed 20000.)
Write a program to model three different kinds of employees in a company using inheritance and File I/O. Your program will consist of three classes that extend the class Employee and a testing class [login to view URL] that reads in payroll information from a file then prints it to the console window.
The Classes Manager, HourlyWorker, and CommissionEmployee:
To model different types of employees, extend the provided abstract class Employee by writing three new classes: Manager, HourlyWorker, and CommissionEmployee. Implement the abstract methods as required. Managers get paid a fixed weekly salary, commission employees get paid based on base salary and commission (commission rate x sales), hourly workers get paid an hourly wage with time-and-a-half: 1.5 times the hourly wage for hours worked over 40 hours. Do not create additional fields, and only write methods that override methods from either Employee or Object.
The Class Payroll:
Create a class called Payroll with a main method to test your classes. This method should create an array of type Employee (think about what size you use?) Then, populate the array using data from the text file [login to view URL] using appropriate Java I/O techniques. Each line of the file will look similar to one of these:
*John, Kanet, 800, 7000, 0.10
@Thomas, Hill, 20, 50
In order to populate the array, you will need to split() each String on the (,) character so you can access each individual value of data. Based on the first value (e.g., #) your method will know whether to create a new Manager, HourlyWorker, or CommissionWorker object. Once created, populate the object with the remaining values then store it in the array. Finally, iterate through the array of employees using the enhanced for loop syntax, and print out each employee in the following format:
Steve Davis $2000
John Kanet $1500 (Base salary: $800, sales: $7000, Commission rate: 10%)
Thomas Hill $1100 (Hourly wage: $20, hours worked: 50)
11 freelancerów złożyło ofertę na kwotę $102 do tego projektu
Hi! My name is Ihor, I will be glad to help you I have strong experience in Java and C# development for 3+ years. Feel free to contact me any time to discuss details.
Hello. It's a simple purely coding task and even the class structure is already written for you in the task description. I can do it in an hour or two starting right after you award me the project.
Hello I have 9+ years experience in Java working on various [login to view URL] project is quite simple for my experience, message me to discuss any details and start now. Have a nice day!
Hello, I am a programmer with 30 years of experience in the development of commercial and industrial systems in c, c ++, Java and databases SQL server, Oracle and db2.