CSD201_-_PE_-_SP_2025_3455.webp
Đ

CSD201_-_PE_-_SP_2025_3455.webp

4. Submission: to submit the project Q1, at first you must select Question No = 1, browse and select the
☑ Kizspy. me project folder (e.g. 1, Q2 or Q1X,,) then click the Submit button. Do the same for other questions.
Do not submit the un-edited given project. If project is too big for submission, delete all f1.txt, f2.txt,.....
5. Do not use accented Vietnamese when writing comments in programs.
6. Do not add new import statement(s) to given files.
7. Software tools must be used: NetBeans IDE 8.x and Java JDK 1.8.
If at least one of the above requirements is not followed, the exam will get ZERO.
Trouble shooting:
If the given project (e.g. Q1) runs with error, you need to run "Clean and Build Project" (Shift+F11). If still
error, try to rename or copy the project to other one, e.g. from Q1 to Q1X or Q1Y,...
The size of data used for grading will be larger than the given one.
Do not pay attention to real meaning of objects, variables and their values in the questions below.
Question 1: (4 marks)
In this question you should complete some methods in MyList.java file.
The class Camel with 3 data members: desert, step and type is given and you do not need to edit it. The
MyList class is a linked list of Camel objects. The following methods should be completed:
void addLast(String xDesert, int xStep, int xType) - check if xDesert.charAt(0) == 'B' then do
nothing, otherwise add new node with desert-xDesert, step-xStep, type-xType to the end of the
list. (step and type 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:
(A,9,8) (C,6,5) (D,2,4) (E,7,9) (F,4,-7) (G,-3,2)
Zoom
void f2()-There are 3 given Camel objects x, y, z in this function. Write statements to insert x,
and to the list en that will ha at naritione? A and [ (The band's nocition is 1 Outut in
Close
+ 83%
Chưa có bình luận nào.

Thông tin

Category
CSD201
Thêm bởi
Đức Long
Ngày thêm
Lượt xem
4,306
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom