PRO192_-_PE_-_SP_2025_-_Block_2_3467.webp
R

PRO192_-_PE_-_SP_2025_-_Block_2_3467.webp

☑Kizspy.me
}
public int f1(String str);
public String f2(String str);
Write a class named MyStringProcessor, which implements the interface IStringProcessor. The class
MyStringProcessor implements methods: f1 and f2 in IStringProcessor as below:


f1: Count the number of lower vowels (a, e, i, o, u) in the input string str (case-sensitive). Return
the total count of vowels.
f2: Find the longest word in the input string str (a word is defined as a substring between spaces).
Return the longest word. If there are multiple words with the same longest length, return the
first one encountered.
The program output might look something like:
1. Test f1()
1. Test f1()
2. Test f2()
2. Test f2()
Enter TC (1 or 2): 1
Enter TC (1 or 2): 2
Enter a string:
Zoom
+ 89%
Enter a string:
This is a string with some words
Close
Chưa có bình luận nào.

Thông tin

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

Share this media

Back
Bên trên Bottom