Well im new to java and am currently working on for loops heres what i have so far, now what i want to try to figure out is lets say i accept input from a user and they enter a coordinate of a point in this program lets say ... (4,6) at that coordinate in the grid instead of a ( " . ") i'd like a
(" * ") to be displayed ..... Can u guys help me ... FYI im a network admin and java is new to me im practising these excersises ..... in my book !
public class try21
{
public static void main(String [] args)
{
for (int i=1; i<=11; i++) // +1
{
System.out.println();
for (int j=14; j>=i; j--)
{
System.out.print(" . ");
}
for (int k=1; k<=i; k++)
{
System.out.print(" . ");
}
}
System.out.println();
}
}
Out Put is :
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
Press any key to continue . . .


Reply With Quote

Bookmarks