Results 1 to 2 of 2
  1. #1
    John Lord is offline Member
    Join Date
    Oct 2010
    Posts
    1
    Rep Power
    0

    Default Help with formatting output

    Hi, I'm new to the forums and i have an assignment that requires the usage of combination formula to find each value in pascal's triangle and print 7 rows of it. I've managed to calculate and print all values but I don't know how to format it to a triangle shape.


    The problem is solved. Thanks for the help.
    Last edited by John Lord; 10-31-2010 at 05:38 PM.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,762
    Blog Entries
    7
    Rep Power
    21

    Default

    [QUOTE=John Lord;152997]Hi, I'm new to the forums and i have an assignment that requires the usage of combination formula to find each value in pascal's triangle and print 7 rows of it. I've managed to calculate and print all values but I don't know how to format it to a triangle shape.

    You can print each number using a fixed width format (read all about it in the PrintStream.printf( ... ) or PrintWriter.printf( ... ) methods API documentation).

    kind regards,

    Jos

Similar Threads

  1. Replies: 2
    Last Post: 07-02-2010, 03:20 PM
  2. formatting numbers in output
    By andy3 in forum New To Java
    Replies: 3
    Last Post: 05-27-2010, 07:43 PM
  3. Formatting output somewhat like a table
    By latereg in forum New To Java
    Replies: 3
    Last Post: 04-06-2010, 07:44 AM
  4. Need help formatting File Output
    By aaroncarpet in forum New To Java
    Replies: 2
    Last Post: 11-26-2009, 06:26 PM
  5. Need help formatting output and some code
    By A5i19 in forum New To Java
    Replies: 6
    Last Post: 11-09-2009, 05:58 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
  •