PRO192_-_PE_-_SU_2024_-_Block_5_2614.webp
K

PRO192_-_PE_-_SU_2024_-_Block_5_2614.webp

OUTPUT:3
Add how many elements: 0
Enter TC(1-f1;2-f2;3-f3): 3 The list before running f3:
(H,8) (G,65) (E,8) (F,47) (E,56) (C,65) (B,8) (A,65)
OUTPUT:
(H,8) (G,65) (E,8) (F,47) (E,56) (C,65) (A,65)
Question 4:
(2 marks) The interface IString below is already compiled and given in byte code format, thus you can use it without creating IString.java file.
public interface IString {
public int f1(String str);
public String f2(String str);
}
Write a class named MyString, which implements the interface IString. The class MyString implements methods f1 and f2 in IString as below:
f1: Count the number of characters that are consonants in string str. (Consonants are defined as any letter in the English alphabet that is not a vowel (a, e, i, o, u). The count should be case-insensitive and exclude any non-alphabetic characters)
f2: Reverse the characters in each word of string str without changing the order of the words (word = a string without space(s)).
+ 100%
Zoom

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

Thông tin

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

Image metadata

Filename
PRO192_-_PE_-_SU_2024_-_Block_5_2614.webp
File size
83.8 KB
Dimensions
1920px x 859px

Share this media

Back
Bên trên Bottom