Hello guys

I am doing a course in Java and i have a small assignment to do, but i am totally confused about it

I am not very good with Java heh, i was wondering if anybody would be so kind as to help me with my problem?

I have to write an applet that will list integers 1 to 10, along with their square roots and the sum total. I have to implement the applet using a grid layout and a definite loop.

I have the basic code working that produces 1-10, square roots and the total, but i am totally lost trying to put them into a grid and i have no idea what a definite loop is!?

I also have to use different class names and convert the program to use a preconditioned loop and a post-conditioned loop.

If somebody would be so kind as to look over my code and suggest solutions to my problems i would be eternally grateful

import java.awt.Graphics;
import java.applet.Applet;

public class As2 extends Applet
{
int[] numbersArray={1,2,3,4,5,6,7,8,9,10}; //Initialise an array of numbers 1-10
public void paint(Graphics g)
{
int num;
int total = 0;
for(int i=0;i<10;i++)
{
num=numbersArray[i]; //'num' will be a number from the array, named 'i'
total=total+num;
System.out.println(""+(i+1)+" "+Math.sqrt(i+1)+" "+total);
}
g.drawString("Total is "+total,50,100);
}
}

Thankyou very much in advance for any assistance

Pyrastilia