In Java please help with the following: Define a class Registration to implement course registration/withdrawal of students. The program should place the code into a try-catch block with multiple catches to check for the validity of various attributes based on the following criteria. a. Student ID must start with a letter and should be followed by four digits. b. The default number of courses must be at least 3. -Print suitable error matches within the catch block. If any of the criteria mentioned above is not fulfilled, the program should loop back and let the user enter new data. -Add methods for the number of courses registered and withdrawn. Create your own exception class which will check inside the method for the courses registered so that after the registration, the maximum number of registered courses should not be more than 6. Also, check inside the method for course withdrawal so that the number of courses after the withdrawal does not go less than 2. -Invoke the defined methods from your main method and catch the exceptions.
In Java please help with the following:
Define a class Registration to implement course registration/withdrawal of students. The
a. Student ID must start with a letter and should be followed by four digits. b. The default number of courses must be at least 3.
-Print suitable error matches within the catch block. If any of the criteria mentioned above is not fulfilled, the program should loop back and let the user enter new data.
-Add methods for the number of courses registered and withdrawn. Create your own exception class which will check inside the method for the courses registered so that after the registration, the maximum number of registered courses should not be more than 6. Also, check inside the method for course withdrawal so that the number of courses after the withdrawal does not go less than 2.
-Invoke the defined methods from your main method and catch the exceptions.
Step by step
Solved in 2 steps with 1 images