Site Search

CS 111: Program 4 main content

Based on Programming Challenges #2 and #3: ShiftSupervisor and TeamLeader classes on page 686 of your textbook.

Write a program that reads in data for five employees from an input file, stores the employee data in an array, and then display the employee's data after the entire file has been read in.

Store your employees in an array of Employee

     Employee[] workers = new Employee[5];

Sample Session

Enter the name of the input file: employees.txt

Name:              Ed Gellenbeck
Employee Number:   123-D
Hire Date:         10/2/2001
Shift:             Day
Hourly Pay Rate:   $12.00

Name:              Fred Stanley
Employee Number:   345-A
Hire Date:         1/20/2000
Annual Salary:     $50,000.00
Production Bonus:  $11,000.00

Name:              Jim Schwing
Employee Number:   899-B
Hire Date:         05/12/2002
Shift:             Day
Hourly Pay Rate:   $100.33
Monthly Bonus:     $2,750.00
Required Training: 15.5 hours
Training Attended: 2.0 hours

Name:              Grant Eastman
Employee Number:   111-C
Hire Date:         11/20/2002
Annual Salary:     $50,000.00
Production Bonus:  $11,000.00

Name:              Boris Kovalerchuk
Employee Number:   105-D
Hire Date:         12/31/2002
Shift:             Day
Hourly Pay Rate:   $75.00
Monthly Bonus:     $1,100.00
Required Training: 5.5 hours
Training Attended: 1.7 hours

Sample Input File

Use the following input file as a sample. The employee type (1, 2, or 3) is highlighted in red only to make this example input more readable. Make no assumptions as to the order of the employees in the input file.

1
Ed Gellenbeck
123-D
10/2/2001
1
12.00
2
Fred Stanley
345-A
1/20/2000
50000
11000
3
Jim Schwing
899-B
05/12/2002
1
100.33
2750
15.5
2.0
2
Grant Eastman
111-C
11/20/2002
50000
11000
3
Boris Kovalerchuk
105-D
12/31/2002
1
75.00
1100
5.5
1.7

Programming Style Requirements

What to turn in

  1. Source program printouts stapled together with file header comments on all printouts
  2. Be sure your project is saved in your u:\Program4\ folder
  3. The assignment is due at the start of lab 5. You program must compile and produce output for you to receive any credit.
    • You are allowed one late programming assignment for the quarter.

Grading Criteria

50 points maximum