Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please Provide screenshot of the classes running. I can provide additional java files if needed upon request. Utility class - TwoDimRaggedArrayUtility The class TwoDimRaggedArrayUtility will
Please Provide screenshot of the classes running. I can provide additional java files if needed upon request.
Utility class - TwoDimRaggedArrayUtility
The class TwoDimRaggedArrayUtility will follow the provided Javadoc and will contain the following methods:
- Method readFile pass in a file and return a two-dimensional ragged array of doubles
- Method writeToFile pass in a two-dimensional ragged array of doubles and a file, and writes the ragged array into the file. Each row is on a separate line and each double is separated by a space.
- Method getTotal pass in a two-dimensional ragged array of doubles and returns the total of the elements in the array.
- Method getAverage pass in a two-dimensional ragged array of doubles and returns the average of the elements in the array (total/num of elements).
- Method getRowTotal pass in a two-dimensional ragged array of doubles and a row index and returns the total of that row. Row index 0 is the first row in the array.
- Method getColumnTotal - pass in a two-dimensional ragged array of doubles and a column index and returns the total of that column. Column index 0 is the first column in the array. If a row doesnt contain that column, it is not an error, that row will not participate in this method.
- Method getHighestInRow - pass in a two-dimensional ragged array of doubles and a row index and returns the largest element in that row. Row index 0 is the first row in the array.
- Method getHighestInRowIndex - pass in a two-dimensional ragged array of doubles and a row index and returns the index of the largest element in that row. Row index 0 is the first row in the array.
- Method getLowestInRow - a two-dimensional ragged array of doubles and a row index and returns the smallest element in that row. Row index 0 is the first row in the array.
- Method getLowestInRowIndex - a two-dimensional ragged array of doubles and a row index and returns the index of the smallest element in that row. Row index 0 is the first row in the array.
- Method getHighestInColumn - pass in a two-dimensional ragged array of doubles and a column index and returns the largest element in that column. Column index 0 is the first column in the array. If a row doesnt contain that column, it is not an error, that row will not participate in this method.
- Method getHighestInColumnIndex - pass in a two-dimensional ragged array of doubles and a column index and returns the index of the largest element in that column. Column index 0 is the first column in the array. If a row doesnt contain that column, it is not an error, that row will not participate in this method.
- Method getLowestInColumn - pass in a two-dimensional ragged array of doubles and a column index and returns the smallest element in that column. Column index 0 is the first column in the array. If a row doesnt contain that column, it is not an error, that row will not participate in this method.
- Method getLowestInColumnIndex - pass in a two-dimensional ragged array of doubles and a column index and returns the index of the smallest element in that column. Column index 0 is the first column in the array. If a row doesnt contain that column, it is not an error, that row will not participate in this method.
- Method getHighestInArray - pass in a two-dimensional ragged array of doubles and returns the largest element in the array.
- Method getLowestInArray - pass in a two-dimensional ragged array of doubles and returns the smallest element in the array.
Utility class HolidayBonus
The class HolidayBonus will follow the provided Javadoc and will contain the following methods:
- Method calculateHolidayBonus pass in a two-dimensional ragged array of doubles, and the bonus amount for the store with the highest sales in a category, the bonus amount for the store with the lowest sales in a category and bonus amount for all other stores. It will return an array of doubles which represents the holiday bonuses for each of the stores in the district. The first entry in the returned array [0] will represent the holiday bonus for the store at [0] in the two-dimensional ragged array of doubles. You will be using methods from the TwoDimRaggedArrayUtility when needed.
- Method calculateTotalHolidayBonus pass in a two-dimensional ragged array of doubles, and the bonus amount for the store with the highest sales in a category, the bonus amount for the store with the lowest sales in a category and bonus amount for all other stores. It will return a double which represents the total of all Holiday Bonuses for the District. You will be using methods from the TwoDimRaggedArrayUtility when needed.
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