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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started