Exercise 2 12 Marks Write A Java Program Named Ssn Java That Prompts The User To Enter A Social Security Number In Fo 1 (34.83 KiB) Viewed 19 times
Exercise 2 12 Marks Write A Java Program Named Ssn Java That Prompts The User To Enter A Social Security Number In Fo 2 (34.83 KiB) Viewed 19 times
Exercise 2: [12 marks] Write a java program named SSN.java that prompts the user to enter a Social Security Number in format of DDD-DDD-DDD, where D is a digit. The first digit cannot be zero. Make sure that second set of three digits is more than 100. Your program should check whether the input is valid. Here are sample runs: Enter a SSN: 123-268-097 123-268-097 is a valid social security number Enter a SSN: 023-289-097 023-289-097 is an invalid social security number Enter a SSN: 198-068-097 198-068-097 is an invalid social security number Enter a SSN: 198-1680-97 198-1688-97 is an invalid social security number
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!