Question
Display a boolean method to determine if a given string contains a valid Missouri license number. Assume a valid license number is in the form
Display a boolean method to determine if a given string contains a valid Missouri license number. Assume a valid license number is in the form of "LLDLDL" with each L representing a letter and each D representing a digit. Allow uppercase and lowercase letters. You may use regular expression related techniques, but only after you can solve the problem with the material we've covered.
Example valid license number strings: DJ3T3X, cc8D0P
Example invalid license number strings: D3J3TX (invalid character at specific index locations), PM5P (too short), BO1T4XJM (too long), U$8E4E (invalid character at specific index locations)
// Returns true if the string parameter contains a valid Missouri
// license number.
public static boolean isValid(String driverLicenseNum) {
/* ADD your work here */
}
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