PRO192_-_PE01_-_SU_2024_2179.webp
Vân Anh1

PRO192_-_PE01_-_SU_2024_2179.webp

<<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%

Thông tin

Category
PRO192
Thêm bởi
Vân Anh1
Ngày thêm
Lượt xem
3,629
Lượt bình luận
1
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
PRO192_-_PE01_-_SU_2024_2179.webp
File size
208.4 KB
Dimensions
1920px x 990px

Share this media

Back
Bên trên Bottom