Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started