Question: your driver should read the data from a text file where each line in the input file represents one item and the line includes the

your driver should read the data from a text file where each line in
the input file represents one item and the line includes the following values separated by
tab: (1) a number (1,2, or 3) to specify whether the line represents an ItemA, ItemB, or
Item object respectively, (2) string value, (3) integer value, and (4) an integer value for
ItemA lines or boolean value for ItemB lines. Assume the input file is formatted correctly
and you do not have to check for lines that are not in the given format. This is an example
input file:
1 aaa 1020
2 bbb 20 true
3 ccc 39
2 aaa 10 false
3 aaa 10
1 ddd 4050
2- Create an input file of at least 20 lines with at least 5 lines for each item type
(Item/ItemA/ItemB). Include some duplicate lines to test that the add method does not
add duplicate items.
3- Write code to ask the user for the path of the data file, read the file name, open the file, read
the file line by line, and upload the data to an SortedSet.
4- Print the list. Make sure the items are in sorted order and there are no duplicates.
5- Include at least two test cases for each one of the following methods: indexOf, remove,
grab, and categorySet. Make sure to print appropriate messages in the output so
that it is easy to interpret your test cases
txt.file
Minnesota, 10000,55110
Kansas, 20000, false
Michigan, 19000
New York, 30000
Washington, 52000

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!