Question: Do correctly in java 1) Write a program to fulfill the following requirement: Class Student 0 2 1 3 2 4 As seen in the

Do correctly in java

1)

Write a program to fulfill the following requirement:

Class

Student

0

2

1

3

2

4

As seen in the above table write a 2D array program to fill in the names of the students in each class and print their names

Sample output: Class 1 Student-1 : Ram Student-2: Sham

Class 2 Student-1 : Ram Student-2: Sham

Student-3: Bheem

Class 3 Student-1 : Ram Student-2: Sham

Student-3: Hanuma

Student-4: Bheem

2)Write a program to create a custom exception UnderAgeException and OverAgeException. Collect the age from the user using the getData() and verify the age based on the following scenario:

if the age is more than 65 throws a custom exception named as OverAgeException

else if age is less than 18 throw a custom exception named as UnderAgeException

else print valid age.

Sample Input: 16 Sample Output: Age is less than 18. Rejected

Sample Input: 67 Sample Output: Age is more than 65. Rejected

Sample Input: 26 Sample Output: Accepted.

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!