Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Program Specification : You are to first design and implement a single class whi

ID: 3709769 • Letter: P

Question

Program Specification: You are to first design and implement a single class which can be used to manage the salaries for a small organization. Implement the given interface and create a Driver to run the program.

The organization has (text) data files for its various units that are formatted as such :

-----------------------------------------------------

<id>:<salary>:<years of service><EOL>

<id>:<salary>:<years of service><EOL>

-----------------------------------------------------

Note:

• the ids are unique and there can not be multiple entries with the same ids

• the entries are arranged in ascending order of id values

Your class must Implement the following interface:

interface Raiseable { // Creates a new (empty) file that can later be used to add entries of the above // format void create(String fileName) // Formats and displays the contents of the specified file to the screen void display(String fileName) // Creates a new file that is a copy of the given input file - with the new // entry added such that the new file is sorted by the entries’ ids // Return true if no match was found and the entry was added; false if a duplicate id boolean addTo(String inFileName, String outFileName, int id, double salary, int yearsOfService) // Creates a new file that is a copy of the given input file - with the specified // entry removed // Returns true if a matching entry was found / removed; false if no such entry exists boolean removeFrom(String inFileName, String outFileName, int id, double salary, int yearsOfService) // Creates a new file that is a copy of the given input file - where all entries whose // years of service are greater than or equal to yearsOfService have had their salaries // increased by salaryIncPercent // Return the number of entries that the raise was applied to int raise(String inFileName, String outFileName, int yearsOfService, double salaryIncPercent) // Creates a new file that is a sorted merge of the two given (sorted) input files // In case of duplicate entries, only the one with the highest salary is kept in // outFileName void mergeFiles(String inFileName1, String inFileName2, String outFileName) }

Rules and Requirements:

• Proper object oriented design practices and conventions are expected • All checked and foreseeable unchecked exceptions must be handled • You may not use ArrayLists or Arrays to buffer the input files during a merge

Explanation / Answer

Hi Dear,

Please find my implementation:

###############

############

Output:

Empty input_salary_data_1.txt created!

Empty input_salary_data_2.txt created!

Is Entry Added? true
Is Entry Added? true
Is Entry Added? true
Is Entry Added? true
Is Entry Added? true
Is Entry Added? true
Is Entry Added? true

Current Employee Salary Info After Addion:
ID: 11111 Salary: 28000.0 Year of Service: 12
ID: 22222 Salary: 22000.0 Year of Service: 13
ID: 33333 Salary: 34000.0 Year of Service: 15
ID: 44444 Salary: 32000.0 Year of Service: 14
ID: 55555 Salary: 25000.0 Year of Service: 12
ID: 66666 Salary: 38000.0 Year of Service: 12
ID: 11111 Salary: 28000.0 Year of Service: 12

Is Entry Removed? false

Current Employee Salary Info after Remove:
Input File not found

Year of Experiance: 15
Percentage Increased: 20
Number Of Employee for Salary Increased: 0
Increased Employee Salary Info:
Input File not found

Current Employee Salary Info after Merging:
ID: 11111 Salary: 28000.0 Year of Service: 12
ID: 22222 Salary: 22000.0 Year of Service: 13
ID: 33333 Salary: 34000.0 Year of Service: 15
ID: 44444 Salary: 32000.0 Year of Service: 14
ID: 55555 Salary: 25000.0 Year of Service: 12
ID: 66666 Salary: 38000.0 Year of Service: 12
ID: 11111 Salary: 28000.0 Year of Service: 12

Process finished with exit code 0

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote