Do not pay attention to real meaning of objects, variables and their values in the questions below.
Question 1: (5 marks)
In this question you should complete some methods in MyList.java file.The class Lion (with 3 data members: place, weight and color is given and you do not need to edit it. The MyList class is a linked list of Lion objects. The following methods should be completed:
void addLast(String xPlace, int xWeight, int xColor) - check if xWeight == 6 then do nothing,otherwise add new node with place=xPlace, weight=xWeight, color=xColor to the end of the list.(weight and color 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:
(Ε,5,-2) (C,3,5) (Κ,-1,4) (Χ,2,-3) (Y,7,8)
+ 150%
Zoom
Close