Question: JAVA due in two hours For this assignment, you will need to write code to process the attached Salary.txt file. Each line in the file

JAVA due in two hours For this assignment, you will need to write code to process the attached Salary.txt file. Each line in the file consists of a faculty members first name, last name, rank, and salary.

Sample data from file:

FirstName1,LastName1,assistant,79174.73 FirstName2,LastName2,associate,70817.75 FirstName3,LastName3,associate,69619.0 FirstName4,LastName4,full,116992.43 FirstName5,LastName5,full,116761.76 FirstName6,LastName6,full,123743.86

To read in the file, simply use:

File file = new File ("Salary.txt"); 

or

FileInputStream file = new FileInputStream ("Salary.txt"); 

Write a program to display the total salary for assistant professors, associate professors, full professors, and all faculty, respectively, and display the average salary for assistant professors, associate professors, full professors, and all faculty, respectively.

Your output should match the following:

Total Salary for Assistant Professors: $2XXXXXX1.91 Total Salary for Associate Professors: $2XXXXXX6.58 Total Salary for Professors: $3XXXXXX1.41 Total Salary for All Faculty: $8XXXXXX9.90 Average Salary for Assistant Professors: $ 6XXX9.55 Average Salary for Associate Professors: $ 8XXX9.26 Average Salary for Professors: $1XXXX9.37 Average Salary for All Faculty: $ 8XXX8.71 HINT: Use split() method defined in the String class to separate the different parts of each line in the file. Use printf() to format your output.

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!