PRO192_-_PE02_-_SU_2024_2181.webp
G

PRO192_-_PE02_-_SU_2024_2181.webp

in the string str. If no matching data is found, return 0
countWordBeginByString (s1:String, s2):int - count the number of words in string s1 that begin with string s2(not case sensitive). Suppose that s1 is a string of words separated by a space. If no matching data is found, return 0
Hints: You can refer to the methods: startsWith(), toLowerCase() of the String class and toLowerCase() of the Character 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:
7 of 7
Paper No: 1
1.Test countCharacters
1.Test countCharacters
2.Test countWordBeginByString
2.Test countWordBeginByString
Enter Test Case No.(1/2):1
Enter Test Case No.(1/2):2
Enter a string:HeLLo WOrld
Enter a string s1:hello world Hello world hello
Enter a character:o
Enter a string s2:hE
OUTPUT:
2
OUTPUT:
3
Zoom

+ 93%
Close
Chưa có bình luận nào.

Thông tin

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

Image metadata

Filename
PRO192_-_PE02_-_SU_2024_2181.webp
File size
152 KB
Dimensions
1920px x 859px

Share this media

Back
Bên trên Bottom