Welcome to the forum! Thanks for taking the time to learn how to post code correctly. If you haven't already, please read
this topic to learn other useful info for new members.
Please format/indent your code correctly. There is also an error that converted the small 'b' into a 'B' and added stray characters afterwards. I've seen this on another site but not this one, so it looks as though this code was simply copied from another forum and pasted here to get help modifying it.
Please post your own code.
For getting input from the keyboard, look into Scanner. You can also Google 'java exception handling' to find tutorials on how to use exceptions in Java.