This week's book giveaway is in the Mac OS forum. We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line! See this thread for details.
Your post looks like a homework problem. We don't like to do other's people's homework - homework is meant for you to learn, and you won't learn anything when somebody else does it for you. So, please DoYourOwnHomework.
So, do you understand the question in your assignment? Did you already write some code yourself? Where do you get stuck? If you want to learn how arrays work in Java, then have a look at Arrays in Sun's Java Tutorials.