# Help with noob school assignment

• 09-23-2009, 02:55 AM
debo3381
Help with noob school assignment
I missed the first 2 weeks of my class and now I'm somewhat lost. This is my first programming class and have never done stuff like this before. I'm sure this is super easy for you guys so any help would be much appreciated.

How can I position the stars without using the space button???
This is what I have so far but I used the space to position the stars:

public class Assignment1
{
//-----------------------------------------------------------------
// Assignment 1
// Create two triangles and answer a math problem
// My name
//-----------------------------------------------------------------
public static void main (String[] args)
{
int math = 1*2*3*4*5*6*7*8*9*10;

System.out.println ("* *******");
System.out.println ("** ******");
System.out.println ("*** *****");
System.out.println ("**** ****");
System.out.println ("***** ***");
System.out.println ("****** ** ");
System.out.println ("******* * \n");

System.out.println ("The Product of 1*2*3*4*5*6*7*8*9*10 = " + math + " \n");
System.out.println ("My Name");
}
}
• 09-23-2009, 03:26 AM
Fubarable
One way to solve this is to use two for-loops, one nested in the other, and in the loop use an if block to call either System.out.print("*") or System.out.print(" ")
• 09-23-2009, 03:40 AM
debo3381
Your speaking spanish to me. If you could break it down a little more for me it would be much appreciated.
• 09-23-2009, 04:02 AM
Fubarable
You would do well to read the tutorials so this all becomes understandable.

Please have a look here:
For Loops
If Statements
Language Basics