# Java - Exemption program help



## Atnevon (Aug 5, 2008)

Hey TPU,

So I have been flogged now with Java. I survived C++. yay!

So I am working on a program now that reads a txt file. I am to tokenize it. From there we have a filter somehow of the following into a new txt file that is to display an average f the students who are exempt.

Now, I got it to compile finally, and I must admit, it is some very sloppy coding. I'm sure I was suppose to have a class file, but it kept giving me to many headaches, so lazy ol' me chucked it into 1 file. Not the best idea, but it will work...hopefully.

Now the problem I am running into is this. The compiler checks ok, and when I go to run it, it prematurely locks up, and I have to force quit. I get a jumbled error message in my DOS prompt, but I'm not sure it it is totally relevant. (Could be my ignorance shining, not sure).

I'm stumped, so if anyone could offer some advice to my siuation, I would be most thankful.

Here be me Source Code:



Yarg!! said:


> import java.io.*;
> import java.util.Scanner;
> import java.util.*;
> 
> ...




Many Thanks,
-At


----------



## Oliver_FF (Aug 7, 2008)

The best way to debug, if you're not using an IDE with debugging features, is to use print statements, use a load of these:

System.out.println("1);

strategically in your code, changing the number as you go - then run it, see where it stops and go from there 


Want to share what it tells you when it stops aswell?


----------



## Atnevon (Aug 8, 2008)

Well, I had to turn it in on Tuesday night. I ended up getting a 12/20. Better than a zero though. 

I'll try that printouts. Hopefully that will help me with my next project, especially since it deals with superclasses.

(pulling neck nervously)
-Andrew


----------

