<<interface>>
TextProcessor
+ remove Whitespace(input:String):String
+ countVowels(input:String):int
Write a class named TextProcessorImpl, which implements the interface TextProcessor. The class TextProcessorImpl implements all methods in TextProcessor as below:
+ remove Whitespace(input:String): String - return the string input with all whitespace characters removed.
+ countVowels (input: String):int - return the number of vowels of the string input (no case sensitive)
Hints: You can refer to the methods: split(), contains(), indexOf(), trim(), replaceAll(), toCharArray() of the String class
-The Main class is provided for you in binary form. You only test your program by running the binary file. There are several test cases for you, as follows:
Enter a string: Helllo
World
Enter a string:hellO
1.Test removeWhitespace
1.Test removeWhitespace
2.Test countVowels
2.Test countVowels
Enter Test Case No.(1/2):1
Enter Test Case No.(1/2):2
OUTPUT:HellloWorld
OUTPUT:
2
Zoom
Close
+ 100%