PRO192_-_PE_-_SP_2025_3457.webp
Sakura_chan

PRO192_-_PE_-_SP_2025_3457.webp

Kizspy.me
poort voru a
Write a class MyRadio, which implements the interface IRadio. The class MyRadio implements methods
f1, f2 and f3 in IRadio as below (you can add other functions in MyRadio class):

.
.
f1: Find the maximum rate of all radios in the list where the content contains at least one digit.
f2: Sort the elements that the radio content starts with a non-digit number in the list ascendingly
by rate (other elements are unchanged).
f3: Remove all radios where the radio content starts with a non-digit number and the radio rate
is equal the minimum rate of all radios in the list. (if there is no element that satisfies the
conditions then do nothing). (Must ensure that the list is updated in-place and maintain its
original order for the remaining elements)
When running, the program will add some data to the list. Sample output might look something like:
4 of 4
Paper No: 2
Add how many elements: 0
Enter TC(1-f1;2-f2;3-f3): 1
The list before running f1:
(VN1,8) (VJ,2) (FR,19) (PJ1,17)
Add how many elements: 0
Enter TC(1-fl;2-f2;3-13): 2
The list before running f2:
(A12,6) (B1X,9) (C34,2) (D2Y,29) (E67,22) (1F,19)
(3G1,12) (2H,5)
OUTPUT:
(C34,2) (A12,6) (BIX,9) (E67,22) (D2Y,29) (1F,19)
(3G1,12) (2H,5)
OUTPUT:
17
Zoom
Add how many elements: 0
Enter TC(1-fl;2-12;3-13): 3
The list before running f3:
+100%
Close
Chưa có bình luận nào.

Thông tin

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

Share this media

Back
Bên trên Bottom