here is the payroll.dat file I'm trying to read:
John Smith
9.45 40 15
Jane Doe
12.50 45 15
Harry Morgan
20.00 40 20
Carmen Martinez
25.00 35 25
Jacintha Washington
50.85 60 34
here is the code to read it and print the results:
As it is there it reads and prints the first employee and data but then I get an input mismatch exception trying to read the second employee, while this code does fine for all but the last (fifth) employee:
How do I get the fifth employee to print out. BTW, gross and net Amounts are previously set to 0.0 for this exercise.
Update: I found that if I use the latter code with an extra " " (space) after the last token in the file, the program works fine. I'm really confused. I could turn it in just like that, but I want to know what's going wrong with the while loop..
Update: then I remove the extra space at the end and for the fifth employee I get a NoSuchElementException: No Line Found
[ February 08, 2006: Message edited by: Jesse Crockett ]
[ February 08, 2006: Message edited by: Jesse Crockett ]