Validating social security number java

Rated 4.55/5 based on 609 customer reviews

So If I were to input 1, It would say that "1 is a valid SSN", and I were to input 123/56/7890 or 123-567-890 it would say that ""123-567-890" or "123-567-890" is not a SSN".

I have imported a Scanner method, and sent out for the user ti imput a social security number.What I need help with is what to put in the body of each method.I need help to return true if there is 11 digits, if the numbers are in the right place, and if the dashes are in the right place.It's kind of a cheat because Scanner most likely uses a Reg Ex internally but you'll never know because the class hides those details from you. — Junilu [How to Ask Questions] [How to Answer Questions] BTW, Leesa, if you're posting code snippets, click on the "Code" button in the editor and put your code snippets between the code "tags" that get created.That will make your code display nicely when you post your message, assuming you format it nicely in the editor.

Leave a Reply