I believe what Athul was trying to say is there is a try at line 16 and is caught at line 33 with catch but there is another catch at line 158 with no other try in the code. I'm not currently at a computer that has an IDE available to quickly test this, but I've searched the code twice and just don't see more than one try statement. However, I am new to Java and I feel since the catch statements are of seperate types one is IOException and the other just Exception they should both be able to be executed with the single try statement. Is it their placeing? Or perhaps too many brackets }? If I had to guess once you catch the try statement you probably should go ahead and declare each catch right then because everything after the catch is no longer affected by the try statement so there would be no way to catch it perse'.
bue curt
Greenhorn
Joined: Dec 25, 2009
Posts: 14
posted
0
Help please, the program would just give error after error. it says that ";" is expected.
Remove catch from outside while and put the following statements in try block and write catch block for it.
answer = dataIn.readLine();
x=Integer.parseInt(answer);
I have done this for you as foll. Its working fine.
I have not read your logic completely but I guess you should use array to store the numbers_in_words and find out the index to search and get the the number in words. This logic will work fine for you.
bue curt
Greenhorn
Joined: Dec 25, 2009
Posts: 14
posted
0
maitrayi vasishtha wrote:Remove catch from outside while and put the following statements in try block and write catch block for it.
answer = dataIn.readLine();
x=Integer.parseInt(answer);
I have done this for you as foll. Its working fine.
I have not read your logic completely but I guess you should use array to store the numbers_in_words and find out the index to search and get the the number in words. This logic will work fine for you.
maitrayi vasishtha wrote:Remove catch from outside while and put the following statements in try block and write catch block for it.
answer = dataIn.readLine();
x=Integer.parseInt(answer);
I have done this for you as foll. Its working fine.
I have not read your logic completely but I guess you should use array to store the numbers_in_words and find out the index to search and get the the number in words. This logic will work fine for you.
meh, it did not work.
Im still trying to figure it out
Bue ,
Put the break in line 147 inside the case 9 , then it will work fine