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