Payroll app with specific limitations
Don't even know where to begin :(
i've created various methods but i'm having trouble i'd be happy to show
my code to whoever wants to see it, however i feel at this point im better
off starting from scratch, the more i read in my textbook the more i can
see how i went about this one the wrong way.
Directions:
a main method that opens the file, creates Employee objects one at a time,
calls the necessary methods on Employee, creates the only Employees object
and calls the necessary methods
a class called Employee that has
• three strings : EmpID, LastName, FirstName
• three doubles: Hours, Rate, Gross
• a method that accepts a Scanner and reads the necessary input for employee
• a method that outputs on a single line and correctly spaced the
necessary fields
• a method that computes gross pay for hourly employees and pays overtime
(1.5*Rate) for hours over 40
• a couple of get operations
a class called Employees that has
• an array of Employee objects sized to 20 maximum employees
• a method to add an Employee to the array of Employees
• a method that prints all employees data as shown below (with borders)
Rules, Constraints and Limits:
no Generics
no altering the data
only the one original data set may be read
the data set may be read only once
only one Employees object may be created
no output occurs until all employee objects have been created, gross pay
calculated, and the file used up
test input for this program may vary in number of employee from 1 to 20
Here is the input:
42345 Bruch Max 40 21.50
23456 Elgar Eddie 43 20.0
34567 Bach John 30 30
12345 Wagner Rick 41 30
88888 Mozart Wolfie 36 40
65432 Chopin Fred 45 23.25
72345 Strauss Butch 50 25
and what the output should look like
=========================================================
42345 Bruch Max 40.00 21.50 $ 860.00
23456 Elgar Eddie 43.00 20.00 $ 890.00
34567 Bach John 30.00 30.00 $ 900.00
12345 Wagner Rick 41.00 30.00 $ 1245.00
88888 Mozart Wolfie 36.00 40.00 $ 1440.00
65432 Chopin Fred 45.00 23.25 $ 1104.38
72345 Strauss Butch 50.00 25.00 $ 1375.00
=========================================================
note: the output should be evenly spaced amongst a line of length 58
No comments:
Post a Comment