aspose file tools*
The moose likes Beginning Java and the fly likes Output of names and sales not formatted properly. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Output of names and sales not formatted properly." Watch "Output of names and sales not formatted properly." New topic
Author

Output of names and sales not formatted properly.

Edward Strife
Greenhorn

Joined: Mar 15, 2012
Posts: 14
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
Bartender

Joined: May 31, 2011
Posts: 1776
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.
 
Consider Paul's rocket mass heater.
 
subject: Output of names and sales not formatted properly.