CSD201_-_PE_-_FA_2023_-_HB_950.webp
M

CSD201_-_PE_-_FA_2023_-_HB_950.webp

void addLast(String xName, int xSalary, int xAbility) - check if xName.charAt(0) == 'A' then do nothing,otherwise add new node with name=xName, salary-xSalary, ability=xAbility to the end of the list. (salaryand ability can get arbitrary, even negative values).
void f1()- Do not edit this method. Your task is to complete the addLast(...) method above only. Output in the file f1.txt must be the following:
(B,5,3) (C,6,5) (D,2,4) (Ε,7,9) (F,4,-7) (G,-3,2)
. void f2()-There are 2 given Worker objects x, y in this function. Suppose the list contains at least 5 elements.
Write statements to insert x and y to the list so that x will be the 1st, y will be the 5th node. Output in the file f2.txt must be the following:
(C,9,8) (D,6,3) (Ε,8,5) (F,5,4) (1,4,9)
(X,1,2) (C,9,8) (D,6,3) (Ε,8,5) (Y,3,4) (F,5,4) (1,4,9)
. void f3() - Find the first node having salary>8 then change its' ability to 100. Output in the file f3.txt must be the following:
(C,8,6) (D,3,5) (E,9,2) (F,5,8) (G,9,7) (H,6,8) (1,7,3)
(C,8,6) (D,3,5) (E,9,100) (F,5,8) (G,9,7) (H,6,8) (1,7,3)
1
Zoom
+ 120%
Close

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

Thông tin

Category
CSD201
Thêm bởi
Mỹ Duyên1
Ngày thêm
Lượt xem
1,985
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Image metadata

Filename
CSD201_-_PE_-_FA_2023_-_HB_950.webp
File size
62.8 KB
Dimensions
1552px x 660px

Share this media

Back
Bên trên Bottom