Results 1 to 4 of 4
  1. #1
    debo3381 is offline Member
    Join Date
    Sep 2009
    Posts
    2
    Rep Power
    0

    Default 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");
    }
    }

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    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(" ")

  3. #3
    debo3381 is offline Member
    Join Date
    Sep 2009
    Posts
    2
    Rep Power
    0

    Default

    Your speaking spanish to me. If you could break it down a little more for me it would be much appreciated.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. Need help with school work
    By ccfdet in forum New To Java
    Replies: 3
    Last Post: 08-29-2009, 07:14 PM
  2. Question about school assignment
    By wata in forum New To Java
    Replies: 7
    Last Post: 08-18-2009, 02:00 PM
  3. school project help
    By justin8790 in forum New To Java
    Replies: 5
    Last Post: 03-22-2009, 09:54 AM
  4. Help im a noob.. a super noob on java..
    By critdevil in forum New To Java
    Replies: 12
    Last Post: 03-07-2009, 03:17 AM
  5. Please help... assignment for school
    By confused2000 in forum New To Java
    Replies: 3
    Last Post: 11-12-2007, 08:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •