Question: JAVA PISTOL Hadaf organization offer a training course only for adults (>18) and want to check applicant's information (ID and age ) before entering the

JAVA  JAVA PISTOL Hadaf organization offer a training course only for adults
(>18) and want to check applicant's information (ID and age ) before

PISTOL Hadaf organization offer a training course only for adults (>18) and want to check applicant's information (ID and age ) before entering the training course. You should write the following methods to complete this task: main method Ask the user to enter het/his ID (String) and birth year (int). Call the method check and print a massage based on the returned value: true print "You are qualified to enter the training course" o false print "You are not qualified to enter the training course" Handle any exceptions might occur in your code and print the Exception in the catch block. . > check method . . The method receives two parameters: the ID as String and the birth year as integer, and returns Boolean value. If ID length is 10 characters, calculate the age using the birth year value (age 2021-birthyear) and return: true if the calculated age greater or equal 18 false if the age less than 18. If ID length is not 10 character throw an Exception with the message: "ID should be 10 characters" NOTES Make sure that all exceptions are handled in the main method. Additional exceptions may occur during the rest of this program. Thies, make sure that your code can avoid any other exception going uncanght. IN s w 2 / 2 58% + MINISTRY OF EDUCATION IMAM ABDUL RAHMAN BIN FAISAL UNIVERSITY COLLEGE OF COMPUTER SCIENCE A INFORMATION TECHNOLOGY | IMAM ABDULRAHMAN BIN FAISAL UNIVERSITY Sample Run Oualified Enter your id: 1834864477 Enter your birth year: 2001 You are qualified to enter the training course BUILD SUCCESSFUL (total tine: 18 seconds) Sample Run 2: Not qualified runt Enter your id: 1632354231 Enter your birth year: 2009 You are not qualified to enter the training course BUILD SUCCESSFUL (total timet 12 seconds) Sample Run 3: Festion ID runt Enter your id: 2344231 Enter your birth year: 2000 java.lang. ExceptionID should be 10 characters BUILD SUCCESSFUL (total tine: 3 seconds) Sample Run.Other Ecction runt Enter your id: 2012432321 Enter your birth year: two java.util. InputmismatchException BUILD SUCCESSFUL (total time 26 seconds) N Os

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!