|
-
Jan 4th, 2007, 06:39 PM
#1
Thread Starter
New Member
IsoTriangle help
i have created a program which prompts the user for the size of an isoceles triangle and then displas the triangle with that many lines but according to myy project it alsso have to inclue drawBar() method and Addspace method which prints the space how can i do that
int size;
System.out.print("Enter Size: ");
size = input.nextInt();
int temp = size;
for (int i = 1; i <= size; i++){
for (int j = temp; j > 0; j--){
System.out.print(" ");
}
for(int j = 0; j < i; j++){
System.out.print("*");
System.out.print(" ");
}
System.out.println();
temp--;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|