Question: JAVA Create a class named TextProcessing which has the following methods (1) getWordsNumber(): this method accepts a string (few sentences long) as an argument and
JAVA
Create a class named TextProcessing which has the following methods
(1) getWordsNumber(): this method accepts a string (few sentences long) as an argument and returns the number of words it contains.
(2) getVowelsNumber(): this method accepts a string (few sentences long) as an argument and returns the number of vowels it contains.
(3) displayBackwardString(): this method accepts a string (few sentences long) as an argument and displays its contents backward.
(4) isValid(String password): this method accepts a password as an argument and verifies whether the password meets the following criteria:
I. The password should be at least eight characters long.
II. The password should contain at least one uppercase and at least one lowercase letter.
III. The password should have at least one digit.
If the password meets the above criteria, the method isValid() returns true. Otherwise, it returns false.
Then write a demo class to work with TextProcessing class.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
