Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

i need help scanning this text file in java the TODO public class Payroll { private ArrayList staffList; private final String HOURLY = Hourly; private

i need help scanning this text file in java the TODO

public class Payroll { private ArrayList staffList; private final String HOURLY = "Hourly"; private final String EXECUTIVE = "Executive"; private final String VOLUNTEER = "Volunteer"; //----------------------------------------------------------------- // Constructor: Sets up the list of staff members. //----------------------------------------------------------------- public Payroll(Scanner file) { this.staffList = new ArrayList(); System.out.println("---> Reading staff data from the file"); // TODO #5 System.out.println("---> Finished reading from the file "); } public void prepareForPayDay() { Random random = new Random(17); // TODO #5 } //----------------------------------------------------------------- // Pays all staff members. //----------------------------------------------------------------- public double[] processPayroll() { double[] pay = new double[this.staffList.size()]; // TODO #5 return pay; } public ArrayList getStaffList() { return new ArrayList(this.staffList); } public void displayStaffData() { // TODO #5 D for(int i = 0; i  
public abstract class StaffMember { private String name; private String address; private String phoneNumber; private String ssn; //----------------------------------------------------------------- // Constructor: Sets up this staff member using the specified // information. //----------------------------------------------------------------- public StaffMember(String name, String address, String phoneNumber, String ssn) { setName(name); setAddress(address); setPhoneNumber(phoneNumber); setSsn(ssn); } public void setName(String name) throws InvalidParameterException { if (name.length() > 0) this.name = name; else throw new InvalidParameterException("Invalid parameter: \"" + name + "\" - The name must have at least one character"); } public String getName() { // TODO #1 D return name; // THIS IS A STUB } public void setAddress(String address) throws InvalidParameterException { // TODO #1 D this.address = address; } public String getAddress() { // TODO #1 D return address; // THIS IS A STUB } public void setPhoneNumber(String phoneNumber) throws InvalidParameterException { // TODO #1 D this.phoneNumber = phoneNumber; } public String getPhoneNumber() { return "??"; // THIS IS A STUB } public void setSsn(String ssn) throws InvalidParameterException { // TODO #1 D this.ssn = ssn; } public String getSsn() { return "??"; // THIS IS A STUB } public boolean equals(Object o) { boolean same = true; if (this != o) { if (o == null || getClass() != o.getClass()) same = false; else { StaffMember other = (StaffMember) o; same = this.name.equals(other.name) && this.address.equals(other.address) && this.phoneNumber.equals(other.phoneNumber) && this.ssn.equals(other.ssn); } } return same; } //----------------------------------------------------------------- // Returns a string including the basic employee information. //----------------------------------------------------------------- public String toString() { return "Name: " + this.name + " " + "Address: " + this.address + " " + "Phone: " + this.phoneNumber + " " + "Social Security Number: " + this.ssn; } //----------------------------------------------------------------- // Derived classes must define the pay method for each type of // employee. //----------------------------------------------------------------- public abstract double calculatePayment(); }image text in transcribed
*staff.txt - Notepad File Edit Format View Help Volunteer, Adrianna,987 Sunset Blvd., (333) 555-8374,576-23-5689 Executive, Anthony, 123 Main Line, (805) 555-0469,123-45-6789, 110423.07 Volunteer, Benny,321 Sunflower Lane, (201) 555-7282,375-22-9056 Hourly, Carl,6 Sixth Ave., (888) 555-6666,123456789 Hourly, Ellen,4 Rainbow,(412) 555-1234,310-28-3145,57.65 Executive, Mark,456 Off Line, (614) 555-0101,123456.78,987-65-4321 Hourly, Mary,6 Sixth Ave., (911) 555-6666,123456789,60.66 Hourly, Michael,678 Fifth Ave., (201) 555-0690,958-47-3625,45.55 Monthly,Jillian, 123 Main Line, (534) 555-0469,123-45-6789,2224.07 Executive, Paulie,456 off Line, (123) 555-0101,987-65-4321, 123456.78 Hourly, Tomas,678 Seven Ave., (815) 555-2692,321-44-6622,35.50 Tony, 123 Main Line, (732) 555-9469,123-45-6789, 222423.07 Hourly, Victor, 789 Off Rocker, (345) 555-0000,010-20-3040,39.23 *staff.txt - Notepad File Edit Format View Help Volunteer, Adrianna,987 Sunset Blvd., (333) 555-8374,576-23-5689 Executive, Anthony, 123 Main Line, (805) 555-0469,123-45-6789, 110423.07 Volunteer, Benny,321 Sunflower Lane, (201) 555-7282,375-22-9056 Hourly, Carl,6 Sixth Ave., (888) 555-6666,123456789 Hourly, Ellen,4 Rainbow,(412) 555-1234,310-28-3145,57.65 Executive, Mark,456 Off Line, (614) 555-0101,123456.78,987-65-4321 Hourly, Mary,6 Sixth Ave., (911) 555-6666,123456789,60.66 Hourly, Michael,678 Fifth Ave., (201) 555-0690,958-47-3625,45.55 Monthly,Jillian, 123 Main Line, (534) 555-0469,123-45-6789,2224.07 Executive, Paulie,456 off Line, (123) 555-0101,987-65-4321, 123456.78 Hourly, Tomas,678 Seven Ave., (815) 555-2692,321-44-6622,35.50 Tony, 123 Main Line, (732) 555-9469,123-45-6789, 222423.07 Hourly, Victor, 789 Off Rocker, (345) 555-0000,010-20-3040,39.23

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions