File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Formatting an output

 
Peter Haugen
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have written a program that calculates the first 100 pentagonal numbers. The problem is that I am supposed to output the answers with 10 answers on each line of the output. I have no idea how to do this. I am guessing that I would want to write a loop and format the output in the loop??? Is any other way to format the output without writing another loop? Here is what I have so far...

 
Peter Haugen
Greenhorn
Posts: 12
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Please be sure to use code tags when posting code to the forums.



Thanks for letting me know and I will be sure to do this in the future.
 
Paul Clapham
Sheriff
Pie
Posts: 20177
25
MySQL Database
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know why your guess involves a loop. The normal way to do something in Java is to call a method which does that thing.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic