llo I need help creating " A TO DO LIST" code in java for an interactive test driver .  Your interactive test driver loop will allow users to: Add a task.  This will require you to capture the subject, priority, and dueDate.  Here are some tips on using Java LocalDates.  Use now() for the startDate.  TaskId should start at 1 and increment each time a task is added.  View the next task in the queue using the peek() method and then optionally complete the current task using the poll() method.  View a list of all tasks.   This will require

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Hello I need help creating " A TO DO LIST" code in java for an interactive test driver .  Your interactive test driver loop will allow users to:

  • Add a task.  This will require you to capture the subject, priority, and dueDate.  Here are some tips on using Java LocalDates.  Use now() for the startDate.  TaskId should start at 1 and increment each time a task is added. 
  • View the next task in the queue using the peek() method and then optionally complete the current task using the poll() method. 
  • View a list of all tasks.   This will require the use of an iterator and the peek() method on each element.  Use isEmpty() to check if there are items in your queue and if not,  display "No tasks in queue." 
  • View a single task by id.  This will require iterating the task list until the id is found and then displaying it. 
  • Remove a task by id.    This will require you to iterate through the Task queue until you find the task with the matching id.  Use remove(task) and confirm to the user that the task has been removed.

 

Sample Output

Welcome to My Task List

Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
a
Adding new Task...
Enter subject:
Square the circle
Enter due date (yyyy-MM-dd):
2020-11-31
Date format exception. Try again.
Enter due date (yyyy-MM-dd):
2020-10-31
Enter priority abbreviation Normal=n,Low=l,High=h,Urgent=u):
l
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
a
Adding new Task...
Enter subject:
Remove the rubble
Enter due date (yyyy-MM-dd):
2020-11-20
Enter priority abbreviation Normal=n,Low=l,High=h,Urgent=u):
n
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
a
Adding new Task...
Enter subject:
Drive the drivers
Enter due date (yyyy-MM-dd):
2020-11-15
Enter priority abbreviation Normal=n,Low=l,High=h,Urgent=u):
h
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
a
Adding new Task...
Enter subject:
Circle the square
Enter due date (yyyy-MM-dd):
2021-11-05
Enter priority abbreviation Normal=n,Low=l,High=h,Urgent=u):
u
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
l
Id:4; Subject: Circle the square; Status: Not Started; Priority: Urgent; StartDate: 2020-10-30; Due date: 2021-11-05
Id:3; Subject: Drive the drivers; Status: Not Started; Priority: High; StartDate: 2020-10-30; Due date: 2020-11-15
Id:2; Subject: Remove the rubble; Status: Not Started; Priority: Normal; StartDate: 2020-10-30; Due date: 2020-11-20
Id:1; Subject: Square the circle; Status: Not Started; Priority: Low; StartDate: 2020-10-30; Due date: 2020-10-31
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
n
Id:4; Subject: Circle the square; Status: Not Started; Priority: Urgent; StartDate: 2020-10-30; Due date: 2021-11-05
Is this task complete? y/n:
y
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
l
Id:3; Subject: Drive the drivers; Status: Not Started; Priority: High; StartDate: 2020-10-30; Due date: 2020-11-15
Id:1; Subject: Square the circle; Status: Not Started; Priority: Low; StartDate: 2020-10-30; Due date: 2020-10-31
Id:2; Subject: Remove the rubble; Status: Not Started; Priority: Normal; StartDate: 2020-10-30; Due date: 2020-11-20
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
e
Enter taskId:
2
TaskId not found...
TaskId not found...
Edit Task:
Enter new subject or press enter to leave unchanged:
Remove the rabble
Enter new due date (yyyy-MM-dd), or press enter to leave unchanged:

Enter status abbreviation Not Started=n,Deferred=d,Waiting=w,Complete=c):
u
Enter priority abbreviation Normal=n,Low=l,High=h,Urgent=u):
l
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
l
Id:3; Subject: Drive the drivers; Status: Not Started; Priority: High; StartDate: 2020-10-30; Due date: 2020-11-15
Id:1; Subject: Square the circle; Status: Not Started; Priority: Low; StartDate: 2020-10-30; Due date: 2020-10-31
Id:2; Subject: Remove the rabble; Status: Not Started; Priority: Low; StartDate: 2020-10-30; Due date: 2020-11-20
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
2
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
e
Enter taskId:
2
TaskId not found...
TaskId not found...
Edit Task:
Enter new subject or press enter to leave unchanged:

Enter new due date (yyyy-MM-dd), or press enter to leave unchanged:

Enter status abbreviation Not Started=n,Deferred=d,Waiting=w,Complete=c):
w
Enter priority abbreviation Normal=n,Low=l,High=h,Urgent=u):
u
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
l
Id:3; Subject: Drive the drivers; Status: Not Started; Priority: High; StartDate: 2020-10-30; Due date: 2020-11-15
Id:1; Subject: Square the circle; Status: Not Started; Priority: Low; StartDate: 2020-10-30; Due date: 2020-10-31
Id:2; Subject: Remove the rabble; Status: Waiting; Priority: Urgent; StartDate: 2020-10-30; Due date: 2020-11-20
Choose action (Add(a),Next(n),List(l),Detail(d),Edit(e),Remove(r),Quit(q):
q
Goodbye

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education