public void f2(List<Speaker> t);public void f3(List<Speaker> t);
Write a class MySpeaker, which implements the interface ISpeaker. The class MySpeaker implements methods f1, f2 and f3 in ISpeaker as below (you can add other functions in MySpeaker class):
f1: Count and return the number of speakers with power > 10.
f2: Sort the first 5 elements in the list ascendingly (other elements are unchanged).
f3: Check if in the list there are at least 2 elements having minimum power then remove the second one (thus if only one element with minimum power then do nothing).
When running, the program will add some data to the list. Sample output might look something like:
Add how many elements: 0 Enter TC(1-f1;2-f2;3-f3): 1
Add how many elements: 0
Enter TC(1-fl;2-f2;3-13): 2 The list before running 12:
The list before running f1:(A2,8) (B1,2) (C3,16) (D4,17) (E5,6)
(A,6) (B,9) (C,2) (D,29) (E,22) (F,19) (G,12) (H,5)
OUTPUT:(C,2) (A,6) (B,9) (E,22) (D,29) (F,19) (G,12) (H,5)
}
4 of 4
Paper No: 1
OUTPUT:
< Zoom
>
90%
Close