Question: COSC 210 Object Oriented and GUI Programming Assignment 5 The objectives of this assignment are to: - Gain experience using the Eclipse IDE; including its

COSC 210 Object Oriented and GUI Programming Assignment 5

The objectives of this assignment are to:

- Gain experience using the Eclipse IDE; including its environment for managing files. - Gain an understanding of processing both text and binary files. - Gain experience in using data structures to hold data in memory. - Develop a small Java program that applies the concepts of objectives 2 and 3. - Practice good programming techniques.

COSC 210 Fundamentals of Computer Science Assignment 5 Problem Statement

Produce a department report from an employee file (Emps.dat) and a department file (Depts.txt).

Input: Employee file - binary with the following fields: Employee ID 4 bytes twos compliment integer First Name 10 bytes ASCII blank padded Last Name 15 bytes ASCII blank padded Department Code 2 bytes ASCII Hire Date 1 byte 2s comp for month, 1 byte 2s comp for day, 2 byte 2s comp for year Employee Type 1 byte ASCII S for Salaried, E for Exempt, H for Part Time Hourly Salary double precision floating point Hourly Rate double precision floating point Vacation Days 2 bytes 2s comp integer Training 1 byte binary

Department file - comma delimited text. Each line in the file represents a department. The comma delimited fields are: Department Code Department Name Employee ID of the manager for the department

Output: Print a report listing of Employees by Department. For each department, print the department name, managers name, number of employees in the department, and the sum of the vacation days of its employees. For each employee, print the employee ID, name, hire date, salary, exempt status, and vacation days. A sample report is provided below:

Administration Department

Manager: Herbert Johnston Staff Size: 36 Vacation Days: 40

ID Employee Name Hire Date Typ Salary Hourly Vac

10640 Nick Stover 05/13/2004 S 30,000.00 15.00 30 10688 John Cochran 09/15/2004 H 13.75 22 10923 Brian Dunlap 01/09/2000 E 105,000.00 4

Engineering Department

Manager: Joseph Johnston Staff Size: 41 Vacation Days: 40

ID Employee Name Hire Date Typ Salary Hourly Vac 10646 Virginia Clawson 01/25/2004 H 16.25 24 10666 Beverly Noel 05/11/2002 S 37,500.00 18.75 18

Implementation Requirements: The data from the files must be loaded into memory before producing the report.

Provide formatting of the date field as shown (MM/DD/YYYY). Provide formatting of the Salary field as shown (###,###.##). Internally use a char for Employee Type and Date for the hire date. Print blanks for Salary of zero, and for Hourly Rate of zero. ABIDE by good programming practices. Define javadoc, good formatting, etc.

COSC 210 Object Oriented and GUI Programming Assignment 5 The objectives ofthis assignment are to: - Gain experience using the Eclipse IDE; includingits environment for managing files. - Gain an understanding of processing both

E 201650-DTSM TH X Home Dropbox -META O e moodle /mod/forum/discuss.php?d 35685 IUP Indiana University of Pennsylvania Moodle IUP Links Search forums Home My courses Courses Spring 2017 Spring 2017 dtsmith Meta Spring 2017 Meta CosC 210 General Assignment Discussion Forum Assignment 5 Tip 1 Assignment Discussion Forum Administration orum administration Display replies in nested form Forced subscription Course administration Assignment 5 Tip 1 My profile settings by David Smith Friday. 17 March 2017, 015 AM Hello, Navigation on assignment 5, the string field is stored in blank padded fields. They are not UTF- Blank padded add spaces blanks to the end of data to fill a fixed number of spaces. For example "John' stored in a 10 Home space blank padded field would be stored as "John That is 6 spaces follow the letters for John. My home Give that the field is not UTF, the readUTF0 method cannot be used to read the data. Instead need to use the read method to first read the bytes into an array of length matching the field. Then convert Site page the bytes into a String. For the above example the following code can be used. My profile byte0 firstNameBytes new byte(101 Spring 2017 in read(firstNameBytes); dtsmith Metal String firstName new String(firstNameBytes). Spring 2017 Metal COSC 210 However with the above firstName for John will include the trailing space. Thus add the trim() method Participants String firstName new String(firstNamel Bytes) trim0 General News forum dave smith Assignmer Discussion Forum Reply Assignme 5 Tip 1 Topic 1 E 201650-DTSM TH X Home Dropbox -META O e moodle /mod/forum/discuss.php?d 35685 IUP Indiana University of Pennsylvania Moodle IUP Links Search forums Home My courses Courses Spring 2017 Spring 2017 dtsmith Meta Spring 2017 Meta CosC 210 General Assignment Discussion Forum Assignment 5 Tip 1 Assignment Discussion Forum Administration orum administration Display replies in nested form Forced subscription Course administration Assignment 5 Tip 1 My profile settings by David Smith Friday. 17 March 2017, 015 AM Hello, Navigation on assignment 5, the string field is stored in blank padded fields. They are not UTF- Blank padded add spaces blanks to the end of data to fill a fixed number of spaces. For example "John' stored in a 10 Home space blank padded field would be stored as "John That is 6 spaces follow the letters for John. My home Give that the field is not UTF, the readUTF0 method cannot be used to read the data. Instead need to use the read method to first read the bytes into an array of length matching the field. Then convert Site page the bytes into a String. For the above example the following code can be used. My profile byte0 firstNameBytes new byte(101 Spring 2017 in read(firstNameBytes); dtsmith Metal String firstName new String(firstNameBytes). Spring 2017 Metal COSC 210 However with the above firstName for John will include the trailing space. Thus add the trim() method Participants String firstName new String(firstNamel Bytes) trim0 General News forum dave smith Assignmer Discussion Forum Reply Assignme 5 Tip 1 Topic 1

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!