To-Do List in the Command Line - Newbie looking for some help, please

HEY FOLKS!

I have been tasked with creating a to-do list using Java. A user must be able to navigate the to-do list from the command line. The suggestion is to use 3 to 5 classes, but this is not a necessity.

The user must be able to: View Name of All To-Do Lists, View Individual To-Do Lists, Add Tasks, Remove Tasks, Record Tasks as Complete, and Create Additional To-Do Lists.

As the title suggests, I’ve only been learning Java for a couple weeks so I am finding this project quite hard to do, so any help would be appreciated.

You can see from the switch statement I have attributed each number to one of the features I mentioned earlier, but I just can’t get my head around it all, especially creating multiple ArrayLists (which I thought was the best way to create my To-Do Lists). I have declared 5 ArrayLists at the top because I cannot understand how to create a method which will create another to-do list when the user wants to.

I began trying to code another switch statement for Case2 but it soon started to get a bit messy and wouldn’t run.

If anyone has done a similar project or any ideas on how to help, I would be extremely grateful because I am beginning to feel this is beyond my capabilities.

Thank you.

import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class mainMenu{

private static List list1 = new ArrayList();
private static List list2 = new ArrayList();
private static List list3 = new ArrayList();
private static List list4 = new ArrayList();
private static List list5 = new ArrayList();

Scanner intScanner = new Scanner(System.in);
Scanner stringScanner = new Scanner(System.in);

public static void main(String[] args) {

    int menuTask = -1;
    while (menuTask != 0) {
        menuTask = menu();
        switch (menuTask) {
        case 1:
            showListNames();
            break;
        case 2:
            viewOneList();
            break;
        case 3:
            addTask();
            break;
        case 4:
            removeTask();
            break;
        case 5:
            confirmComplete();
            break;
        case 6:
            createNewList();
            break;
        case 0:
            break;
        default:
            System.out.println("Enter a valid option");
        }
    }
}

public static int menu(){
  System.out.println("----------------------");
  System.out.println("Main Menu");
  System.out.println("----------------------");
  System.out.println("1. View All To-Do Lists Names");
  System.out.println("2. View Invidual To-Do List");
  System.out.println("3. Add Task to List");
  System.out.println("4. Remove Task From List");
  System.out.println("5. Record Task as Complete");
  System.out.println("6. Create New To-Do List");
  System.out.println("0. Exit the program");
  System.out.println("----------------------");
  System.out.print("Enter choice: ");
  int option = scanner.nextInt();
  return option;
}

//case 2
public static void viewOneList(){
System.out.print("Which list would you like to view? ");
int option = intScanner.nextInt();

  switch (option) {
  case 1:
      System.out.println("-----------");
      Iterator<ToDoTasks> list6 = list1.iterator();
      while (list6.hasNext()){
          ToDoTasks lists = list6.next();
          System.out.println(lists);
      }
      break;

  case 2:
      System.out.println("-----------");
      Iterator<ToDoTasks> list7 = list2.iterator();
      while (list7.hasNext()){
          ToDoTasks lists = list7.next();
          System.out.println(lists);
      }
      break;

  case 3:
      System.out.println("-----------");
      Iterator<ToDoTasks> list8 = list3.iterator();
      while (list8.hasNext()){
          ToDoTasks lists = list8.next();
          System.out.println(lists);
      }
      break;

  case 4:
      System.out.println("-----------");
      Iterator<ToDoTasks> list9 = list4.iterator();
      while (list9.hasNext()){
          ToDoTasks lists = list9.next();
          System.out.println(lists);
      }
      break;

  case 5:
      System.out.println("-----------");
      Iterator<ToDoTasks> list10 = list5.iterator();
      while (list10.hasNext()){
          ToDoTasks lists = list10.next();
          System.out.println(lists);
      }
      break;

  default:
      System.out.println("Enter a valid option: ");
  }
}

}

You created scanner objects intScanner and stringScanner at the beginning,
but later, you have
int option = scanner.nextInt();
where you called the object scanner.

You only need one scanner object for user input here.

details

You could do
Scanner scanner = new Scanner(System.in);
at the beginning
and change every intScanner to scanner and every stringScanner to scanner