Determine the length of the string


Discuss teh below:

Q: Write an interactive Java program that illustrates the use of methods, constructors, loops and arrays. Your Program will do the following:

1. Ask the user for a String input of letters, i.e., Ohio; John Doe; AnyTown. Notice that strings with spaces are allowed.

2. Offer your user two choices:

1. Determine the length of the string

2. Determine how many consonants and how many vowels are in the word.

3. You must write your own method to determine the length of the String (do not use String's length() method).

4. You must error check your users' input for numbers and special characters.

5. You must give your user three opportunities for wrong input before you terminate the program.

6. In the absence of three consecutive erroneous input attempts, your user must have the opportunity to continue running the program until directly deciding to terminate.

Solution Preview :

Prepared by a verified Expert
Data Structure & Algorithms: Determine the length of the string
Reference No:- TGS01931905

Now Priced at $20 (50% Discount)

Recommended (93%)

Rated (4.5/5)