Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant imports and fix indentations #27

Merged
merged 1 commit into from
Mar 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions src/main/java/seedu/duke/Timetable.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package seedu.duke;

import java.lang.reflect.Array;
import java.util.ArrayList;

public class Timetable {
//todo
protected ArrayList<ArrayList<Task>> daysOfWeek = new ArrayList<>(7);;
protected ArrayList<ArrayList<Task>> daysOfWeek = new ArrayList<>(7);
public Timetable() {
initializeTimetable();
}

private void initializeTimetable() {
for (int i = 0; i < 7; i++) {
daysOfWeek.add(new ArrayList<>());
Expand All @@ -27,12 +24,11 @@ public void deleteUserTask(int dayOfWeek, int index){

ArrayList<Task> tasks = daysOfWeek.get(dayOfWeek - 1);
if (index < tasks.size()){
Task taskDeleted = tasks.get(index);
tasks.remove(index);
System.out.println("Task " + taskDeleted.description + "is deleted from " + dayOfWeek);

Task taskDeleted = tasks.get(index);
tasks.remove(index);
System.out.println("Task " + taskDeleted.description + "is deleted from " + dayOfWeek);
} else{
System.out.println("Invalid task index. Please try again");
System.out.println("Invalid task index. Please try again");
}
}

Expand Down
3 changes: 0 additions & 3 deletions src/test/java/seedu/duke/DukeTest.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package seedu.duke;
import seedu.duke.UserList;
import seedu.duke.ui.UI;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand All @@ -19,7 +17,6 @@ public void sampleTest() {
@Test
public void testInvalidCommand() {
// Arrange
UserList userList = new UserList();
ByteArrayInputStream in = new ByteArrayInputStream("invalid\nbye\n".getBytes());
System.setIn(in);

Expand Down
Loading