PRO192_-_PE_-_SP_2024_-_Block_5_1920.webp
E

PRO192_-_PE_-_SP_2024_-_Block_5_1920.webp

public interface IUser {
}
public int f1(List<User> t);
public void f2(List<User> t);
public void f3(List<User> t);
Write a class MyUser, which implements the interface IUser. The class MyUser implements methods f1,f2 and f3 in IUser as below (you can add other functions in MyUser class):
f1: Calculate the maximum of status of the elements that the second character of name is a number (Assume that there are at least 1 element that satisfies the condition).
f2: Reverse the second 3 elements in the list (from the 4th element to 6th element, other elements are unchanged) (Assume that there are at least 6 elements).
f3: Rename the first element by the last element having maximum status.
When running, the program will add some data to the list. Sample output might look something like:
Add how many elements: 0
Add how many elements: 0
Enter TC(1-f1;2-f2;3-3): 1
Enter TC(1-fl;2-f2;3-13): 2
The list before running f2:
(A,6) (B,9) (C,2) (D,9) (E,2) (F,9) (G,2) (H,5)
OUTPUT:
Zoom

90%

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

Thông tin

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

Image metadata

Filename
PRO192_-_PE_-_SP_2024_-_Block_5_1920.webp
File size
151.2 KB
Dimensions
1193px x 792px

Share this media

Back
Bên trên Bottom