Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Simple AT: transactions not visible

 
Greenhorn
Posts: 7
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey people! I got a issue with my code.. Everything is fine about it, only the transactions doesn't show. I have tried a bunch of stuff, but can't seem to get it right.



Does anyone see the problem? '
 
Bartender
Posts: 2236
63
IntelliJ IDE Firefox Browser Spring Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the problems you have way too much logic inside your main method.
Other problem is you pass everything around static method. It is not how you are supposed to write OO code.
Third problem is each of those methods is public. Only declare public what needs to be public.
 
Greenhorn
Posts: 16
2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

William Nyqvister wrote:Does anyone see the problem? '



Ditto to Pawel's advice.

The problem appears to be the makeTransactions calls in lines 30 and 46. No matter what is input, the amount variable contains 0. That is, the net change amount of each transaction isn't being passed, so it isn't stored in the trans array.

Good luck!

Scott
 
reply
    Bookmark Topic Watch Topic
  • New Topic