File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Output of names and sales not formatted properly.

 
Edward Strife
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I have completed all the required calculations however I am a bit stuck as how to format them for proper output. Since my loops are contained in their own method I cannot iterate through them one by one. The output should resemble:

John Doe 23% 13%
Jane Doe 32% 47%

However my output resembles:

John Doe
Jane Doe
.............23%
.............32%
...................13%
...................47%

(Spaces replace the periods shown in this example)

Any help would be greatly appreciated.

 
John Jai
Rancher
Posts: 1776
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have not shown SalesPerson or the SortedListOfSalesperson class.

Anyways, instead of having three print methods, you can have only one print() method. Here iterate the list and compute sales and expenses for each SalesPerson.

So in your final print statement have like

And make your print() method void - you have got three print methods returning values that is not used.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic