Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Originally posted by Dirk Schreckmann:
Think integer division and modulus.
Greg Ostravich - SCPJ2
I didn't use the @return because you don't really return a value from your compute method.
Somebody suggested using an Array or ArrayList for the change. There's a rule about software that suggests if you're seeing code repeated you should refactor to do that functionality once (if you can) - in this case I believe you can.
See if you can store the change in an array. You'll want the change stored in descending order (25, 10, 5, 1) and then iterate through the array and do your calculations for each coin.