JAVA PROGRAMMING Write a class named ToDoItem. The class represents a single item in a list of things that a person wants to get done. This class would be useful in an app that helps a person organize their daily activities. The app might show a list of things that need to be done and allow the user to check them off as they are completed.  The class must have three member variables:  a String that describes the item an integer that stores the priority. (The higher the int value, the higher the priority.) a boolean that stores whether or not the item is completed.   The Class should have three constructors: ToDoItem(String description, int priority, boolean isCompleted) ToDoItem(String description, int priority) ToDoItem(String description) In the second constructor isCompleted should be set to false. In the third constructor isCompleted should be set to false, and priority should be set to 0.   Your class should have getters, but not setters, for the description, priority, and isCompleted variables. The getters should be named getDescription(), getPriority(), and getIsCompleted(). Be sure to give the correct return types.  Your class must have a method named equalTo(ToDoItem o) that returns true if the parameter item has a description, priority, and isCompleted values that match the object that equals is invoked on. Make sure that you compare String values properly. When you finish with above... Write a static method named urgentAndIncomplete. Write the method as if it is in Main.java. It is not part of the ToDoItem class. The method should accept three ToDoItem references as parameters, and return an int.  It should count how many of the ToDoItems meet two criteria: A priority greater than 3 Not completed The method should return how many of the parameters meet these criteria. That will be either 0, 1, 2, or 3.

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

JAVA PROGRAMMING

Write a class named ToDoItem. The class represents a single item in a list of things that a person wants to get done. This class would be useful in an app that helps a person organize their daily activities. The app might show a list of things that need to be done and allow the user to check them off as they are completed. 

The class must have three member variables: 

  • a String that describes the item
  • an integer that stores the priority. (The higher the int value, the higher the priority.)
  • a boolean that stores whether or not the item is completed.  

The Class should have three constructors:

  • ToDoItem(String description, int priority, boolean isCompleted)
  • ToDoItem(String description, int priority)
  • ToDoItem(String description)

In the second constructor isCompleted should be set to false. In the third constructor isCompleted should be set to false, and priority should be set to 0.  

Your class should have getters, but not setters, for the description, priority, and isCompleted variables. The getters should be named getDescription(), getPriority(), and getIsCompleted(). Be sure to give the correct return types. 

Your class must have a method named equalTo(ToDoItem o) that returns true if the parameter item has a description, priority, and isCompleted values that match the object that equals is invoked on. Make sure that you compare String values properly.

When you finish with above... Write a static method named urgentAndIncomplete. Write the method as if it is in Main.java. It is not part of the ToDoItem class.

The method should accept three ToDoItem references as parameters, and return an int.  It should count how many of the ToDoItems meet two criteria:

  • A priority greater than 3
  • Not completed

The method should return how many of the parameters meet these criteria. That will be either 0, 1, 2, or 3. 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 3 images

Blurred answer
Knowledge Booster
Class
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