Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

What does the tape hum lucidum do ?

Answered: 1 week ago

Question

The persistence of vision for the human eye is....,....?

Answered: 1 week ago