Results 1 to 2 of 2
Thread: Help with formatting output
- 10-31-2010, 12:59 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 1
- Rep Power
- 0
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.
- 10-31-2010, 01:10 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
[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
-
Formatting java command line output - Multi line string
By dricco in forum New To JavaReplies: 2Last Post: 07-02-2010, 03:20 PM -
formatting numbers in output
By andy3 in forum New To JavaReplies: 3Last Post: 05-27-2010, 07:43 PM -
Formatting output somewhat like a table
By latereg in forum New To JavaReplies: 3Last Post: 04-06-2010, 07:44 AM -
Need help formatting File Output
By aaroncarpet in forum New To JavaReplies: 2Last Post: 11-26-2009, 06:26 PM -
Need help formatting output and some code
By A5i19 in forum New To JavaReplies: 6Last Post: 11-09-2009, 05:58 AM
Bookmarks