Ok, I'm having a difficult time seeing why I can't get this program to print into two seperate outfiles. I have the program printing into the first outfile fine with the teams that have an above .500 win percentage but the second outfile bottom.dat remains blank. One reason is I think I'm declaring the outfiles wrong, but I'm not real sure. Anyone have any suggestions? heres my code:
Looks more or less OK (at least, insofar as it should do what you want it to do) except that you don't close outLossFile, only outFile. The output may not appear until the files are closed, and if PrintWriter is buffering the data, exiting the program may leave unclosed files still empty.
Thank you much, very simple mistake on my part. Thanks for pointing that out to me
posted 14 years ago
I have another question. I have to output a dialog box saying there is a certain number of winning and losing teams. So I have to declare the teams in the one file winning and the other losing correct? I can't find anything on teh web about declaring something thats within an outfile..Or do i have to use StringTokenizer;?
I also noticed that the first team in the list within the infile isnt printing in either of hte outfiles.. do i have to have an outfile.println above the while loop to get it in the files?
fixed the problem with the first team not printing into the appropriate outfile.