MCPcopy Create free account
hub / github.com/PrajaktaSathe/Java / viewTask

Method viewTask

Programs/ToDoList.java:52–71  ·  view source on GitHub ↗
(ArrayList<String> tasks)

Source from the content-addressed store, hash-verified

50 }
51
52 static void viewTask(ArrayList<String> tasks) {
53 if (tasks.isEmpty()) {
54 System.out.println("""
55 --------------------
56 No current tasks!
57 --------------------""");
58 } else {
59 System.out.println("""
60 --------------------
61 Tasks
62 --------------------""");
63 int counter = 1;
64 for (int i = 0; i < tasks.size(); i++) {
65 System.out.println(counter + "- " + tasks.get(i));
66 counter++;
67 }
68 }
69 System.out.println("\nSelect from the following commands:");
70 list(tasks);
71 }
72
73 static void deleteTasks(ArrayList<String> tasks) {
74 tasks.clear();

Callers 1

chooseMethod · 0.95

Calls 3

listMethod · 0.95
isEmptyMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected