CSD201_-_PE_-_01_-_SU_2022_-_Trial_2847.webp
ThaiNgoc2003

CSD201_-_PE_-_01_-_SU_2022_-_Trial_2847.webp

void addLast(String xOwner, int xPrice) - check if xOwner.charAt(0) = 'A' or xPrice>100 then do nothing, otherwise add new car with owner=xOwner, price=xPrice, price=xPrice to the end of the list. (price can get arbitrary value, even negative).
void f1() - This method is used to test the addLast methode above. You do not need to edit this function. Output in the file f1.txt must be the following:(B,3) (C,7) (D,2) (E,6) (F,4)
void f2() - There are given objects x and y. You should write statements so that y will be the first element of the list. Output in the file f2.txt must be the following:
(C,9) (D,6) (E,8) (F,2) (1,6)
(Y,2) (C,9) (D,6) (E,8) (F,2) (1,6)
1
void f3() - Suppose the list contains at least 3 elements. Delete the second node having price=5.Output in the file f3.txt must be the following:(C,9) (D,5) (E,3) (F,5) (1,6)
(C,9) (D,5) (E,3) (1,6)
Zoom

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

Thông tin

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

Image metadata

Filename
CSD201_-_PE_-_01_-_SU_2022_-_Trial_2847.webp
File size
167.3 KB
Dimensions
957px x 792px

Share this media

Back
Bên trên Bottom