-
Notifications
You must be signed in to change notification settings - Fork 0
/
ListTasks.java
33 lines (27 loc) · 759 Bytes
/
ListTasks.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package com.nicole.taskmanager;
import java.util.ArrayList;
public class ListTasks implements Task {
//Optional parameter
String taskName;
// Default Constructor
public ListTasks() {
taskName = "";
}
//Getter Methods
public String getTask() {
return taskName;
}
//List all the task in the array list including those completed
public void listTasks(ArrayList<String> taskList, ArrayList<Boolean> isCompleted) {
for(int i = 0; i < taskList.size(); i++) {
int number = i + 1;
if(isCompleted.get(i) == true) {
System.out.println(number + ". " + taskList.get(i) + "(Completed)");
}
else if(isCompleted.get(i) == false) {
System.out.println(number + ". " + taskList.get(i));
}
}
System.out.println(" ");
}
}