Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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: a number or to specify whether the line represents an ItemA, ItemB, or
Item object respectively, string value, integer value, and 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:
aaa
bbb true
ccc
aaa false
aaa
ddd
Create an input file of at least lines with at least lines for each item type
ItemItemAItemB Include some duplicate lines to test that the add method does not
add duplicate items.
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.
Print the list. Make sure the items are in sorted order and there are no duplicates.
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
txtfile
Minnesota,
Kansas, false
Michigan,
New York,
Washington,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started