Hi, I've been stuck and completely lost on my Java class program since yesterday and I cannot seem to figure out how to resolve these issues since these are just the beginning parts of the program. Can someone guide/hint to me what I need? I will be putting up the parts where I'm stuck at and giving some general information.
I have two classes, SalesStats and Divisions.
In SalesStats class, I have a main that creates a Division object. I'm not sure what the arrays are suppose to be.
I am to read a file and store the data into two dimensional arrays with a method called readValues(Divisions d). This method is to store the file into array d.
The file input is like this:
I need to set this up so that the arrays will read as 6 rows (divisions) and 4 columns (quarters).
If you have final ints, declare sales as new double[DIVISIONS][QUARTERS] rather than using 6 and 4. If you have the numbers, you might as well use them, and that style reduces the risk of errors like entering 5 by mistake.
Also, since you are assigning sales in the setSales method, you will create a new array every time you run that method and lose all you old information. Similarly for your getSales method. You want to create sales in a constructor, I think.