import [Link].
ArrayList;
import [Link];
public class TodoList {
public static void main(String[] args) {
ArrayList tasks = new ArrayList();
Scanner sc = new Scanner([Link]);
int choice;
do {
[Link]("TO-DO LIST");
[Link]("1. Add task");
[Link]("2. View ");
[Link]("3. Remove");
[Link]("4. Exit");
[Link]("Enter choice: ");
choice = [Link]();
[Link]();
switch(choice) {
case 1:
[Link]("Enter task: ");
String task = [Link]();
[Link]("Task added!");
break;
case 2:
if([Link]()) {
[Link]("No tasks yet");
} else {
[Link]("Your tasks:");
for(int i = 0; i < [Link](); i++) {
[Link]((i+1) + ". " + [Link](i));
break;
case 3:
[Link]("Enter task number to remove: ");
int num = [Link]();
if(num > 0 && num <= [Link]()) {
[Link](num-1);
[Link]("Task removed!");
} else {
[Link]("Invalid number");
break;
case 4:
[Link]("bye!");
break;
default:
[Link]("Invalid choice");
} while(choice != 4);