Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

My question is I have a txt file with several lines of info which include first name lastname hourly rate (since its a payroll program.) they are comma seperated. So i have use JoptionPane and read individual line and ask user how many hours first person worked. After input it goes thru the whole file (loop) asking how many hours each person worked. so far i have done that , i used strinktokenizer to read file line and comma delimited. but i cannot display it

OpenStudy (anonymous):

My current code is. while((rec=fileIn.readLine())!=null) { tok = new StringTokenizer(rec, ", ")

OpenStudy (e.mccormick):

That is the code with some gaps... big ones. Hopw about changing: ``` tok = new StringTokenizer(rec, ", ") ``` to ``` StringTokenizer tok = new StringTokenizer(rec, ", ") ``` And here are a few sites with examples of use: http://www.mkyong.com/java/java-stringtokenizer-example/ http://www.java-tips.org/java-se-tips/java.util/how-to-use-stringtokenizer.html

OpenStudy (anonymous):

thanks. I solved the program.!!

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!