Question
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
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 and a Main Program.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started