Starting from:

$20

Assignment 5 utility class that manipulates a two dimensional ragged array of doubles solution

Concepts Utilized in this Project

· Creating classes based on Javadoc

· Two Dimensional Arrays

· Passing two dimensional arrays to and from methods

· Creating a Utility class (static methods)

· JUnit testing

· Reading from a file

· Writing to a file

· Using methods of the utility class within an existing GUI driver class

o Must follow Javadoc to implement correctly



Overview

Create a utility class that manipulates a two dimensional ragged array of doubles. It will accommodate positive and negative numbers. Follow the Javadoc provided.
This utility class will be used with an existing GUI class to create a sales report.

Testing of the utility class will be done with the JUnit tests and the GUI class provided for you.



Specifications & Requirements
When GUI application starts, user is shown display of Store Names and Item Names

User selects Load Sales Data to select the file containing the sales data. The application then displays the sales for each store and each item as well as the totals for the store and the totals for the item. The store with the highest sales for each item will be highlighted.

Exit will exit the application.

Utility class

The class TwoDimRaggedArrayUtility will follow the provided Javadoc and will contain the following methods:

1. Method readFile – pass in a file and return a two dimensional ragged array of doubles

2. 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.

3. Method getTotal – pass in a two dimensional ragged array of doubles and returns the total of the elements in the array.

4. 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).

5. 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.

6. 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 doesn’t contain that column, it is not an error, that row will not participate in this method.

7. 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.

8. 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.

9. 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 doesn’t contain that column, it is not an error, that row will not participate in this method.

10. 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 doesn’t contain that column, it is not an error, that row will not participate in this method.

11. Method getHighestInArray - pass in a two dimensional ragged array of doubles and returns the largest element in the array.

12. Method getLowestInArray - pass in a two dimensional ragged array of doubles and returns the smallest element in the array.



GUI Application – provided for you

1. Uses methods of TwoDimRaggedArrayUtility

2. When the Load Sales Data button is selected the sales data is read from a file and displayed on the screen with the sales data as well as the totals for each store and the totals for each item. The largest sales for each item is highlighted.

3. The file contains a row for each store and each double in the row is separated by a space

4. Student must provide two additional input files and a screenshot of the results of each. Each file will have 6 rows and up to 6 numbers on each row. They must represent ragged arrays.



JUnit Test

1. Contains test for each of the methods of TwoDimRaggedArrayUtility

2. Student will fill in values for a new dataset – called dataSetSTUDENT

3. Student will implement the STUDENT test files using the dataSetSTUDENT.



Deliverables / Submissions:

Submit a compressed file containing the follow (see below): The Java application (it must compile and run correctly); Javadoc files in a directory; a write-up as specified below. Be sure to review the provided project rubric to understand project expectations. The write-up will include:

Test Cases (These are the ones you will use in your STUDENT test methods in the JUnit test)
Prepare a test table with a list of test cases (expected versus actual results) that you are testing the application with
UML diagrams
Any assumptions that you are making for this project
In three or more paragraphs, highlights of your learning experience




Deliverable format: The above deliverables will be packaged as follows. Two compressed files in the following formats:

LastNameFirstName_Assignment5_Complete.zip [a compressed file containing the following]

o Write up (Word document)

o src [a directory] contains your (.java) files

§ File1.java (example)

§ File2.java (example)

§ File_Test.java (example)

LastNameFirstName_Assignment5_Moss.zip [a compressed file containing only . java files]

NO FOLDERS!!

File1.java (example)

File2.java (example)

More products