Question: Implement an ItemArraySeq of some sort of Item objects. You get to choose what the item is(item = books). You will start with an empty

Implement an ItemArraySeq of some sort of Item objects. You get to choose what the item is(item = books). You will start with an empty array sequence based on the DoubleArraySeq.java class(https://github.com/McMullen/CSC-103-Lab2/blob/master/DoubleArraySeq.java). You will add Item objects from a text file. Each Item must have a unique key so you can insert the Item in the proper location in the sequence and delete it.

Details: Create a class of Items, which you name something sensible (not Item). Your Item must have the following properties: It has a meaningful name (not Item) has at least 2+ attributes. o One attribute is a String that you will use as a key when inserting an Item in lexicographic order. Or, the key can consist of multiple attributes, so long as you document what the key is. o At least one attribute has to be a primitive. o All the attributes should fit on one 80-character line, space-separated. All attributes are private. Modify the DoubleArraySeq.java method to create a collection ItemArraySeq (using the name of your item in place of Item).(so on the DoubleArraySequence skeleton, replace any word that says double with the item name when nessessary). Make a constructor that creates an Item from the information you read from a file. Create an empty ItemArraySeq and add Items to the sequence.

o If the Item you are trying to add is already in the sequence, report that to the console (but not the output file) and dont add the item.

o After adding all the items, it should print out the sequence to both the console and an output file, one item per line.

The input file should have each Item on one line, with its attributes space-separated.

Implement a toString() method for your Item that prints the attributes of your item to the console and to an output file.

You may modify the methods in the DoubleArraySequence if you'd like.

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!