Hallo everyone i need help with my program which is supposed to read the file icecream.dat , i have put the .dat file and textIO file in the same location with the program
and this is my code
I shall go back and add code tags to your post; you should always use the tags. You can see how much better it will look
The exception you are suffering is probably caused by using Eclipse and ignoring its warning not to run the code. Go back to the source code and look for little red marks at the left, and tell us which like the error occurs on. If you hover your mouse on the red mark, you will get a popup box with more details of what the error is.
What is TextIO? It isn't in the java.io package. How do you get an Illegal Argument Exception from it? Why have you not closed the catch with a } before reading the file? Why are you mixing ints and doubles like that. If you have 1000000000 ice‑creams and 999999999 of them are strawberry, when you divide the two ints, what will the percentage of strawberry come out as? Why are you trying to squeeze so much into the main method?
[Edit]I see you are using NetBeans. I didn't know NetBeans allowed you to try uncompilable code, too. But it is the same sort of problem; you need to work out what the compiler error is from the information the IDE gives you. Or stop using an IDE.