Programme Leader of ITMB wants to check whether the student number and GSM number entered by the student for the programming contest is valid or not. Write a Java program to read the Student ID and GSM Number of a student. Use a method called ValidityDetails () for checking the validity of details entered. If the Student ID doesn’t start with the characters ST and contains more than 6 letters or if the Mobile Number does not contain exactly 8 digits, throw a user defined exception InvalidDetailsException. If the details entered are valid, display the message ‘”correct details are entered!!!” otherwise display “Entered invalid details!!!!” please make sure to answer each point especially (If the Student ID doesn’t start with the characters ST)
Programme Leader of ITMB wants to check whether the student number and GSM number
entered by the student for the
Write a Java program to read the Student ID and GSM Number of a student. Use a method called
ValidityDetails () for checking the validity of details entered.
If the Student ID doesn’t start with the characters ST and contains more than 6 letters or if the
Mobile Number does not contain exactly 8 digits, throw a user defined exception
InvalidDetailsException.
If the details entered are valid, display the message ‘”correct details are entered!!!” otherwise
display “Entered invalid details!!!!”
please make sure to answer each point especially (If the Student ID doesn’t start with the characters ST)
Step by step
Solved in 3 steps with 4 images