Would just like to know what the implementation of the add method looks like. Thank you :)

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Would just like to know what the implementation of the add method looks like. Thank you :)

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:
●
●
●
● 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.
●
It has a meaningful name (not Item)
At has 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.
At least one attribute has to be a primitive.
All the attributes should fit on one 80-character line, space-separated.
O
O
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 don't 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.
Transcribed Image Text: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: ● ● ● ● 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. ● It has a meaningful name (not Item) At has 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. At least one attribute has to be a primitive. All the attributes should fit on one 80-character line, space-separated. O O 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 don't 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.
Expert Solution
Step 1

Answer:

We have implement the add method in the java code and this is not the full code only have asked the add method implementation so we have done in java programming lanaguage.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Avoiding deadlock
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education