3 Write an application that prompts the user for a String th

3. Write an application that prompts the user for a String that contains at least five letters and at least five digits. Continuously reprompt the user until a valid String is entered. Display a message indicating whether the user was successful or did not enter enough digits, letters, or both. Save the file as FiveLettersAndFiveDigits.java.

Solution

Call this function and check whether if it has 5 letters and 5 digits public boolean check(String input){ int numDigits = 0; int numLetters = 0; for(int i=0; i= 5) && (numLetters >= 5); } while(!check(message)){ // get the input again and assign it to message }
3. Write an application that prompts the user for a String that contains at least five letters and at least five digits. Continuously reprompt the user until a

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site