i have a problem with my code the problem i am stuck with is the method yeraly stats were i am asked to take the value of two arrays of integers represting the amount produced for each year and display the average amount produced for each shift team was wondering if you could help and tell my what part of my code is wrong or missing?
What errors are you getting?
In the yearly stats method the bit were it says double average = the year 2008 bit and 2009 is underlined
You should change
for (int i=0; i>year.length; i++)
for (int i=0; i<year.length; i++),
I did have that done but then I think the yearlystats 2008 and 2009 in the main method were underlined?
Perhaps you should show your updated code -- using code tags please and post the actual error messages. Put comments in your code to show us where the errors are occurring.
Originally Posted by jamiem
To use code tags, highlight your pasted code (please be sure that it is already formatted when you paste it into the forum; the code tags don't magically format unformatted code) and then press the code button, and your code will have tags.
Another way to do this is to manually place the tags into your code by placing the tag [code] above your pasted code and the tag [/code] below your pasted code like so:
Best of luck!
// your code goes here
// notice how the top and bottom tags are different
ran through this whole question expecting decent formatting.... oh then fubarble had to tell you in the end...nobody does unformatted code unless they are seriouly bored, that never happens by the way..
next time, show what errors you have after compilation. I spent the time to compile your code, and found that most of them is declaration errors. If you want to use year2008 or year2009 in other functions, then don't declare them inside main(). Make them "globally" available.
at least now it compiles. As for logic of the code, you have to do yourself.
public class Assignment //start class
private static int year2008=new int ; //2008 array
private static int year2009=new int ; //2009 array
public static void main (Stringargs) //start main method