Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement an Item ArraySeq of some sort of Item objects. You get to choose what the item is. You will start with an empty array

Implement an ItemArraySeq of some sort of Item objects. You get to choose what the item is. 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, which you can use to insert the Item in the proper location in the sequence.

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)

At has 2+ attributes.

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.

At least one attribute has to be a primitive.

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).

Create a constructor that creates an Item from the information you read from a file.

Create an empty ItemArraySeq

Add Items to the sequence.

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.

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

Students also viewed these Databases questions

Question

How is a gain or loss on the sale of a plant asset computed?

Answered: 1 week ago