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


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks