NOTE: As per the problem statement we did used the exact method descriptions. As the employee.txt is not given in text format so i used only 6 of the employee details manually put on the employee.txt, but you can run it on your system with full input file that you have.
P.S. ask for further clarification(if needed).
JAVA code for the above problem:
import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class AvaCam {
private static double overtimeRate = 0;
private static int count = 0;
private static double totalPayroll = 0;
private static double totalTaxes = 0;
private static double payrollCheckTotal = 0;
public static void userInstruct(){
JOptionPane.showMessageDialog(new JFrame(),"This program
does:\n"
+ "\nDisplay Payroll"
+ "\nWrite
Payroll","Welcome",JOptionPane.INFORMATION_MESSAGE);
}
private static double findSalary(double hours, double
rateOfPay, double overtimeRate){
double salary = (hours>40)?
(40)*rateOfPay : hours*rateOfPay; //base salary
salary += (hours>40)? (hours -
40)*overtimeRate : 0;//including overtime
return salary;
}
private static double findTaxes(double salary){
double taxes = 0;
if(salary <= 250.0) taxes =
0.18*salary;
else if(salary <= 550.0) taxes =
0.23 * salary;
else if(salary <= 1100.0) taxes
= 0.28*salary;
else taxes = 0.33 * salary;
return taxes;
}
private static double findNetIncome(double salary,
double taxes){
return salary - taxes;
}
public static void displayPayroll(double hours, double
salary, double taxes, double netIncome){
JOptionPane.showMessageDialog(new
JFrame(),"Hours: "+hours
+ "\nSalary: "+salary
+ "\nTaxed: "+taxes
+ "\nNet Come:
"+netIncome,"Payroll",JOptionPane.INFORMATION_MESSAGE);
}
public static void displayPayroll(double hours, double
salary, double taxes, double netIncome, double payRate, double
overtimeRate){
JOptionPane.showMessageDialog(new
JFrame(),"Hours: "+hours
+ "\nPay Rate: "+payRate
+ "\nOverTime Rate: "+overtimeRate
+ "\nSalary: "+salary
+ "\nTaxed: "+taxes
+ "\nNet Come:
"+netIncome,"Payroll",JOptionPane.INFORMATION_MESSAGE);
}
public static void writePayroll(double hours, double
salary, double taxes, double netIncome, PrintWriter
printWriter){
printWriter.write(" "+hours+"
"+salary+" "+taxes+"
"+netIncome+"\n");
}
public static void writePayroll(double hours, double
salary, double taxes, double netIncome, double payRate, double
overtimeRate, PrintWriter printWriter){
printWriter.write(" "+payRate+"
"+overtimeRate+" "+hours+" "+salary+" "+taxes+"
"+netIncome+"\n");
}
public static void main(String[] args) {
userInstruct();
String num =
JOptionPane.showInputDialog(new JFrame(),"Enter number of employees
to be processed: ");
try {
File myObj = new
File("C:\\Users\\user\\Desktop\\employees.txt");
PrintWriter printWriter = new
PrintWriter(new
File("C:\\Users\\user\\Desktop\\output_employees.txt"));
Scanner myReader = new
Scanner(myObj);
overtimeRate =
Double.parseDouble(myReader.nextLine().replaceAll(" ", ""));
while (myReader.hasNextLine())
{
String data =
myReader.nextLine();
String info[] =
data.split(" ");
String fname =
info[0];
String lname =
info[1];
double payRate =
Double.parseDouble(info[2].replaceAll(" ",""));
double hoursWorked
= Double.parseDouble(info[3].replaceAll(" ",""));
//
System.out.println(fname+" "+lname);
double salary =
findSalary(hoursWorked, payRate, overtimeRate);
double taxes =
findTaxes(salary);
double netIncome =
findNetIncome(salary, taxes);
displayPayroll(hoursWorked, salary, taxes, netIncome, payRate,
netIncome);
printWriter.write(fname+"\t"+lname);
writePayroll(hoursWorked, salary, taxes, netIncome, payRate,
netIncome, printWriter);
count++;
totalPayroll +=
salary;
totalTaxes +=
taxes;
payrollCheckTotal
+= netIncome;
}
printWriter.write("\n\nTotal
number of employees processed: "+count+"\nTotal Payroll:
"+totalPayroll
+"\nTotal Taxes:
"+totalTaxes
+ "\nTotal
Payroll Checks: "+payrollCheckTotal);
myReader.close();
printWriter.flush();
printWriter.close();
} catch (FileNotFoundException e)
{
System.out.println("An error
occurred.");
e.printStackTrace();
}
}
}
The demo employee.txt:

The output.txt file for above input file:
The dialog box screenshots:
1.
2.
3. For each employee this type of dialog box is popping
up as follows:![fname = info[@]; lname = info[1]; AvaCam [Java Application] C:\Program Files\Java\jdk1 Tao Alexander payRate Double.parseDoub](http://img.homeworklib.com/questions/86f63a90-23df-11eb-bdd6-097edcef77d1.png?x-oss-process=image/resize,w_560)
The screenshot of above code snippets for better understanding:




employees.txt Instructions You will be using Eclipse for all assignments in this course. You can download...
By editing the code below to include composition, enums, toString; must do the following: Prompt the user to enter their birth date and hire date (see Fig. 8.7, 8.8 and 8.9 examples) in addition to the previous user input Create a new class that validates the dates that are input (can copy date class from the book) Incorporate composition into your class with these dates Use enums to identify the employee status as fulltime (40 or more hours worked for...
JAVA Programming . Description: For an unknown number of employees: prompt and receive payroll data; calculate gross pay, taxes owed, and net pay; and display a pay stub. Input : Prompt and receive input from the user for the following: /// Employee’s First and Last Name /// Hours Worked /// Pay Rate /// Overtime Rate Multiplier ** For the Employee’s First and Last Name: Both data items must be read in one prompting into one...
If the employee is a supervisor calculate her paycheck as her yearly salary / 52 (weekly pay) If the employee is not a supervisor and she worked 40 hours or less calculate her paycheck as her hourly wage * hours worked (regular pay) If the employee is not a supervisor and worked more than 40 hours calculate her paycheck as her (hourly wage * 40 ) + (1 ½ times here hourly wage * her hours worked over 40) (overtime...
Given attached you will find a file from Programming Challenge 5 of chapter 6 with required you to write a Payroll class that calculates an employee’s payroll. Write exception classes for the following error conditions: An empty string is given for the employee’s name. An invalid value is given to the employee’s ID number. If you implemented this field as a string, then an empty string could be invalid. If you implemented this field as a numeric variable, then a...
I would like help and there are three different classes in the
coding..
14.11 Prog11 Inheritance(PayrollOvertime) Create three files to submit: • Payroll class.java -Base class definition • PayrollOvertime.jave - Derived class definition • ClientClass.java - contains main() method Implement the two user define classes with the following specifications: Payroll class (the base class) (4 pts) • 5 data fields(protected) o String name - Initialized in default constructor to "John Doe" o int ID - Initialized in default constructor to...
Create a dual-alternative selection structure using Python: A company ABC asked you to design a simple payroll program that calculates and employee's weekly gross pay, including any overtime wages. If employees work over 40 hours in a week, they will get 1.5 times of their regular hourly rate for all hours over 40. Your program asks the user to input hours worked for a week, regular hourly rate, and then display the weekly gross pay Output sample Enter weekly hours...
Java Programming Reading from a Text File
Write a Java program that will use an object of the Scanner class to read employee payroll data from a text file The Text file payroll.dat has the following: 100 Washington Marx Jung Darwin George 40 200 300 400 Kar Car Charles 50 22.532 15 30 The order of the data and its types stored in the file are as follows: Data EmployeelD Last name FirstName HoursWorked double HourlyRate Data Tvpe String String...
RUN THIS PROGRAM ON NETBEANS As a Software Developer, you have received a requirement from a Company to implement a prototype for its payroll system. You receive the following specifications: If an employee works more than its regular hours, it is considered overtime and it will be paid based on the employee’s experience. All employees are paid biweekly (80 hours) Employee taxes: 1% This company manages three categories of workers based on employee’s experience. Group 1 (Silver) o Pay rate:...
Requesting help with the following C Program: DESIGN and IMPLEMENT a menu driven program that uses the following menu and can perform all menu items: Enter a payroll record for one person Display all paycheck stubs Display total gross payroll from all pay records. Quit program The program will reuse the DATE struct from the previous assignment. You should also copy in the functions relating to a DATE. The program will create a PAYRECORD struct with the following fields: typedef struct...
The following needs to be in C programming ! Outcomes: Demonstrate the ability to design a menu driven program. Demonstrate the ability to reuse previous code to create a new assignment. Demonstrate the ability to use appropriate program logic. Program Specifications: DESIGN and IMPLEMENT a menu driven program that uses the following menu and can perform all menu items: Enter a payroll record for one person Display all paycheck stubs Display total gross payroll from all pay records. Quit program...