Yeah, you've got a problem with the loop. Fix that, and then I'll take a look at the rest.
for (int i = 0; i < 10; i++)
{
x = y/10;
System.out.print("*");
}
You want to increment while a condition is true. For instance, in this case we start with:
i = 0;
which is our couting variable.
The second thing is the condition. The condition here is:
i<10;
That means we will keep looping as long as 'i' is less than 10.
The third thing in the loop, is the increment statement. In this example:
i++
means that for each round in the loop, 'i' will be incremented by one. The first time you program runs the looping looks like this;
i=0
i IS less than 10
i is incremented by one(now it is 1)
a start is printed
Second time:
i=1 //from the first increment
i is still less than 10
i is incremented //now equals 2
Another star is printed.
It goes on and on until the looping condition is not true(i is greater than or equal to 10).