Usually when you're continuing a previous topic, it's best to put your new post as an "Add" to the existing topic, rather than as a separate topic. The old topic will appear "new" once it has a new post in it (i.e. the date/time appearing next to the topic will be the date/time of the most recent post, and the topic will appear at the top of the topic list until something even newer is posted). By adding to the previous post, you make it easier for everyone to have the complete context of your problem. And you prevent anyone from wasting their time responding to the original post if you've already solved some of the problems (as in this case) - they can see the most recent version of your code
in the same thread, without having to search elsewhere. Which is usually easier for all of us.
Anyway...
I think your primary problem right now is in the OrderWithCharge toString() method. You call super.toString() - but you don't
do anything with the
String that this method returns. I think you want to append this to your StringBuffer somewhere, e.g.:
Some other observations...
In class ProcessOrders:
The various private static arrays aren't used for anything, are they? If you do need to save the order info for use later, I'd use either a single OrderWithCharge[] array, or a Collection such as ArrayList containing OrderWithCharge elements.
Initializing all your array lengths to 4 seems questionable - what if this number needs to change later? I'd replace each 4 with a variable (probably static and final), such as MAX_RECORD_COUNT. Then it's easy to change later if you need to. OF course, if you use some sort of Collection you probably won't need to specify a maximum size anyway - the Collection will simply grow as you add elements to it.
Inside the processOrder() method, there seems to be a lot of redundant stuff. The OrderWithCharge constructor appears to set name,id,qt,prc,item - there's no need to set these again immediately after using owc.setCustName(name) etc.
In class OrderWithCharge:
Again, the static arrays are pretty suspicious looking - why are they needed? It seems that all the data you need are already declared as instance (non-static) fields of either Order or OrderWithCharge - just use these fields.
It looks like your computeCharges() method is doing a lot more work than it needs to - for each individual order, it's rereading the quantities and recalculating the charges for
all the orders. Why? It seems that quantities have already been read from the orderin.txt file - are the quantities in charges.dat different? If they are, then you shoudl probably use different names to distinguish the two types of quantitites. In any event, if you need to read the file charges.dat in addition to orderin.txt, just do it once, in a static method somewhere - and put the data you've read into the appropriate fields in your array/Collection or OrderWithCharge objects.
Hope that helps. Good luck...
[ December 15, 2002: Message edited by: Jim Yingst ]