Question: String toDoList; Scanner getSize = new Scanner(System.in); Scanner getTask = new Scanner(System.in); int size = 0; String task = , confirm = ; System.out.println(How many

String toDoList; Scanner getSize = new Scanner(System.in); Scanner getTask = new Scanner(System.in); int size = 0; String task = "", confirm = ""; System.out.println("How many tasks do you have to complete today?"); size = getSize.nextInt(); toDoList = new String[size]; for (int i = 0; i < toDoList.length; i++) { System.out.println("Enter a task then press enter:"); task = getTask.nextLine(); System.out.println("This task will be added to your list:"); System.out.println("\t" + task); System.out.println("Type yes to confirm:"); confirm = getTask.nextLine(); if (confirm.equalsIgnoreCase("yes")) { if (i != 0) { if (toDoList[i - 1] == null) { i--; toDoList[i] = task; } else { toDoList[i] = task; } } else { toDoList[i] = task; } } else if (i == (toDoList.length - 1)) { i--; } } System.out.println("Your To Do List for today:"); for (int i = 0; i < toDoList.length; i++) { System.out.println(toDoList[i]); } A. Display char array B. Sum all number values within an array C. Searching array D. Print array contents E. Copying array F. Initialize array with user input G. Initialize array with random values

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!