repl.it
linkLevel-3
, A-TextUiTesting
optional1 Submit weekly exercises
2 Create a Pull Request during/after the lecture
After pushing some code to your fork, create a pull request (PR) from your fork to https://github.com/nus-tic2002-2019/duke
After creating the Pull Request (PR), go to its description (it contains a list of items similar to the below) and tick the items you have completed already.
Level-1
Level-2
Level-3
Level-4
3 Implement project increments Level-3
, A-TextUiTesting
optional
Level-3
: Mark as Done
Add the ability to mark tasks as done.
list
____________________________________________________________
Here are the tasks in your list:
1.[✓] read book
2.[✗] return book
3.[✗] buy bread
____________________________________________________________
done 2
____________________________________________________________
Nice! I've marked this task as done:
[✓] return book
____________________________________________________________
When implementing this feature, you are also recommended to implement the following extension as collections classes (e.g., ArrayList
) have methods to easily delete an item at a specified location:
While it is possible to represent a task list as a multi-dimensional array containing Task
class to represent tasks.
public class Task {
protected String description;
protected boolean isDone;
public Task(String description) {
this.description = description;
this.isDone = false;
}
public String getStatusIcon() {
return (isDone ? "\u2713" : "\u2718"); //return tick or X symbols
}
//...
}
Task t = new Taks("read book");
t.markAsDone()
Level-1
Level-2
Level-3
Level-4