Question: Write a Java program that executes user - defined exception handling on a Scholarship Eligibility Check Program for the potential candidates. The program should prompt
Write a Java program that executes userdefined exception handling on a Scholarship
Eligibility Check Program for the potential candidates. The program should prompt
users to input their details, such as name, residency status, date of birth, first
language, phone number, and email address. It should validate each input against
eligibility criteria and throw specific exceptions such as InvalidInputException using
the throws and throw keyword with clear error messages if any criterion is not met.
Finally, the program should display whether the student is eligible for the scholarship
or not based on the entered information.
Use all keywords discussed in the Lecture.
Eligibility Criteria:
Candidate should be a resident of Ireland.
Candidates date of birth should be in DDMMYYYY format.
Based on the candidates date of birth, their age should be between and
years.
Candidate's first language should be English.
Phone number should be in XXXXXXXX format.
Email should be in proper format like xyz@example.com.
Prompt the user to enter their information, including:
Name
Residency Status YesNo
Date of Birth
English as First Language YesNo
Phone Number
Email Address
Implement exception handling to ensure that the entered information meets the
eligibility criteria. If any criterion is not met, throw an appropriate exception with an
informative error message.
Display a message indicating whether the student is eligible for the scholarship or not
based on the entered information.Hilme:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
