Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Design and implement a Java class (name it SummerStats. java) that tracks statistics for summer job salaries for a group of people over several years.
Design and implement a Java class (name it SummerStats. java) that tracks statistics for summer job salaries for a group of people over several years. The only data field you need is a 2-Dimenssional array of values representing salaries. The rows the represents the people and the columns represent the years. The constructor method takes two integers representing the number of people and the number of years, then randomly generates the annual salaries and fills the array. Other class methods include the following: A method to return the index of the person having made the most money over the years. A method to return the index of the year when the highest salary was earned. A method to return the total amount of money made by a person (specified row index). A method to return the total amount of money made by all the people over the years. A method to return the index of the person who made the highest salary in a given year (specified by column index). A method to return a 1 -Dimensional array of the average salary for each year. A method that return another 2-Dimensional array sorted by the total earning per person over the years. For example, if person in index 4 has the most earning over the years, then that would be the first row in the returned array. In other word, the array is sorted by the total of each row. Write a test program to create an object of this class and test all of the class methods on that objects. Use proper labels in your output. Document your code, and organize and space the outputs properly. Use escape characters and formatting objects when applicable
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started