Create a Student class with the following: A private String variable named “fNam
ID: 3634802 • Letter: C
Question
Create a Student class with the following:
A private String variable named “fName” to store the student’s first name
A private String variable named “mName” to store the student’s middle name
A private String variable named “lName” to store the student’s last name
A private String variable named “UFID” that contains the unique ID number for this student
A private String variable named “DOB” to store the student’s date of birth
A public constructor Student() which will set default names, IDs and DOB:
Several public set methods:
SetNames(String name) will store the first word in name to fName, last word to lName, and if the name contains a middle name, store in mName. (Note: it is possible that the input String has just two words, but never 4 or more words.)
SetUFID(String id) will check whether id is a valid UFID in the format of xxxx-xxxx where x is a single digit. If so, it will set UFID accordingly. Otherwise, give a message and do not change the UFID.
SetDOB(String dob) will check whether the input String is in the format of MM/DD/YYYY and also with valid date. E.g., 02/30/1999 is not a valid date since February does not have 30 days, while Feb 12, 1999 is not a valid format. You should allow user to input date without unnecessary 0 in it, e.g., 2/3/1999 is valid.
A set of Get methods to retrieve the name/UFID/DOB info.
A public method toString() returns a String in the following format:
Name: Last name, first name
UFID: xxxx-xxxx
D.O.B: MM/DD/YYYY