• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Wrong output from salesReport, array not filling properly.

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I need to print out the percentages of total sales and total expenses for each salesperson. For some reason I am only getting the last salespersons name and percentages. Also before my list starts, it outputs all names and the last persons percentages.



The text file (sales.txt) shows:

Smith Kevin
80475 3966.27
Medina Norelis
71040 5677.21
Bailey Van
28305 11276.65
Keepes Karen
58830 7388.15
Keepes Ron
64935 6532.68
Carey Harry
34410 10810.03
Hairy Mata
40515 9954.56
Hurry Mata
52725 8243.62
Hurry Caine
46620 9099.09
Petz Edz
77145 4821.74
 
Marshal
Posts: 76082
362
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can’t debug a whole class like a “black box”You are going to have to put some debugging code in that class. Get it to print out each line as you fill it. Then you can see what it happening.

And don’t use Float or float. You should really use BigDecimal.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic