Question: Java Program: The goal of this assignment is to give you some experience working with text files, classes and objects, and arrays/collections. This program will
Java Program:
The goal of this assignment is to give you some experience working with text files, classes and objects, and arrays/collections. This program will require you to read information from a text file and write the results to a text file as well as the screen. The input text file will contain a number of employee records where each record will be on a separate line and all the employee values will be separated by the semi-colon character (;). Each employee record will contain the employee's ID, full name, position, hourly rate, and hours worked. You need to create an Employee class with the necessary fields, getter/setter methods, constructors, and methods for the class. The Employee class cannot contain any code that displays output to the user, get input from the keyboard or input text file, or write output to the text file; this is the responsibility of the program. The Employee class is simply a new data type that represents employee information. The program needs to open a user-specified text file that will contain a line of text for each employee, read the employee's record (ID, full name, position, hourly rate, hours worked), create a new Employee class object that stores the employee's data, and store this object in an array or collection. The program must calculate and display each employee's gross pay before taxes which includes overtime, the breakdown for each tax deduction, and the employee's pay after taxes along with the employees information. This output information will be displayed on the screen and it's separate from the information that will be written to an output text file. Finally, the program must write the employee's ID number, full name, and net pay to an output text file; this should be done for all employees. See the input and out examples below. Notes:
The overtime rate is double the employee's hourly rate for all hours over 40; the first 40 hours receive the normal rate. The Federal Tax rate is 30%, the Medicare Tax is 1.35%, and Social Security Tax rate is 2.62%.
The information written to the screen and the output text file must come from the objects inside the array/collection.
All calculations must be performed on the objects inside the array collection.
Example input file format: 1001; Albert Einstein; scientist; 75.00; 20 3022; Bruce Wayne; CEO; 200; 40 ... Screen Output: Employee ID: 1001 Employee Name: Albert Einstein Position: Scientist Gross Pay: $1500.00 Federal Taxes: $450.00 Medicare: $20.25 Social Security: $39.30 Net Pay: $990.45 ---------------------------------------------------- Employee ID: 3022 Employee Name: Bruce Wayne Position: CEO Gross Pay: $8000.00 Federal Taxes: $2400.00 Medicare: $108.00 Social Security: $209.60 Net Pay: $5282.40 Example output file: 1001; Albert Einstein; $990.45 3022; Bruce Wayne; $5282.40
This assignment requires to have an Employee class .java file that contains fields, getters/setters, constructors, and methods. The other .java file will be the Test(Main) Program which should store this object in an array or collection and might use index to read the files so it can show the output screen. This program must be able to use other values besides the example.
You'll want to set up a loop for the section where it reads in the first line of text from the file. You only need to print to the screen after you sent your information to the employee class like this line[0] = Employee.setName( Whatever info you're trying to set name to);
Thank you.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
