Question: Problem Description You will be writing programs to manage collections of things where you get to choose the thing in the collection. Since you will

Problem Description
You will be writing programs to manage collections of "things" where you get to choose the "thing" in the collection. Since you will be reusing your "Thing" class across more than one program, please choose something that interests you.
Note: You can be creative about your thing. However, it is prohibited to use any of the following: book, point, line, circle, grocery item, student, person, bank account, menu item, car, pet, song
Thing Class
[2 points] Create a Thing class. The name is not Thing!!! The name is whatever your thing is. Your Thing class must have the following characteristics:
[3 points] Include at least 3 private instance variables (fields) such that: o the first instance variable must be of type String and this variable will be used as a search key
o the second instance variable must be integer (i.e., int) and this variable will be used to find aggregate information about Things that are stored in a collection class as will be explained later o the third variable must be of type boolean
[3 points] Implement a three-arguments constructor for your Thing class. The arguments must be in the order (String, int, boolean).
x 6 points] Implement getters and setters for all the attributes of your Thing.
[5 points] Implement a toString() method that returns a String representation of your Thing where all the instance variables are in one line and separated by tabs
[5 points] Implement the equals() method for your Thing where two Things are considered equal when they have the same search key. Note that, the equality of String attributes should be case insensitive. For example, "MATH", "math" and "Math" match each other. In order to compare strings in Java use the String's equalsIgnoreCase() method. For example, the following code should print true:
String str1= "Hello";
String str2= "hello";
System.out.println(str1.equalsIgnoreCase(str2));
[5 points] Implement the compareTo() method for your Thing. compareTo() returns
a negative number when the invoking object's search key is less than the parameter's search key
.0 when the two search keys are equal
a positive number when the invoking object's search key is greater than the parameter's search key
For example, "ant".compareTo("bat") will return a negative number. Your compareTo() method must compare two Things. Note that the comparison of String attributes should be case insensitive. For example, "MATH", "math" and "Math" must match each other.
 Problem Description You will be writing programs to manage collections of

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 Databases Questions!