Notice that the driver and its helper class are for testing purpose only. They should not be…

Notice that the driver and its helper class are for testing purpose only. They should not be included in the design diagram. B. Project description Project 1 Abstract Data Type(ADT) Bag An ADT Bag is composed of a list of grocery items and a set of operations on the list. You may think of a grocery bag as an instance of the ADT Bag. A grocery bag contains a list of groceries. There is a set of operations that operate on the list. For example, we can add an item, remove an item, count the number of items, check for a specific item, etc. In this project, you will design an ADT bag by following software development cycle including specification, design, implementation, test/debug, and documentation Specification/Analysis: The ADT Bag must contain the following operations: create an empty bag that can hold up to 100 items • add an item to the end of the list of this bag- insert(item) • remove the item at the end of this bag – removeLast() • remove an item at a random index from this bag – remove Random() • get the index of the first occurrence of an item from this bag – geta reference to an item) • get a reference to an item at position index of this bag/get/index)). • check how many items are there in this bag – size() • check to see if this bag is empty.isEmpty() • empty this bag – makeEmpty() Design: Complete a UML diagram to include all classes that are needed to meet the specifications. An interface class needs to be defined to specify the design of each operation. In the interface, what each operation does is specified. A class implementing this interface needs to be defined to specify how each operation does and a data structure is selected to store a collection of data. Exceptions should to be considered when operations are designed Java has two types of exceptions:checked exceptions and runtime exceptions. Checked exceptions are instances of classes that are sub classes of java.lang.Exception class. They must be handled locally or explicitly thrown from the method. They are typically used when the method encounters a serious problem. In some cases, the error may be considered serious enough that the program should be terminated. Runtime exceptions occur when the error is not considered as serious. These types of exceptions can often be prevented by fail-safe programming. For example, it is fairly easy to avoid allowing an array index to go out of range, a 7 situation that causes the runtime exception ArrayIndexOutOfBounds Exception to be thrown. Runtime exceptions are instances of classes that are subclasses of the java.lang.RuntimeException class. RuntimeException is a subclass of java.lang. Exception that relaxes the requirement forcing the exception to be either handled or explicitly thrown by the method. In general, some operations of an ADT list/ADT Bag can be provided with an index value. If the index value is out of range, an exception should be thrown. Therefore, a subclass of IndexOutOfBoundException needs to be defined Also, an exception is needed when the list/bag storing the items becomes full. A subclass of java.lang.RuntimeException should be defined for this erroneous situation. A full ADT bag should throw an exception when a new item is inserted. Similarly, an empty ADT Bag should throw an exception when removing an item from it. Code/Implementation: A class implementing the interface needs to be written to specify how each operation does and a data structure is selected to store a collection of data. An array must be used to store all items in an ADT Bag. The element type of the array should be Object type-the ultimate superclass of all other classes. When organizing items in the array, all items must be stored consecutively. This means shifting may be needed after some insertion or removal operations. Javadoc comments need be written during this activity. Class comments must be included right above the corresponding class header. Method comments must be included right above the corresponding method header. Comments are also needed in each method to document each block of statements. Debug/Testing: Note: It is required to store all testing data in a file. It is required to use decomposition design technique. To test the ADT bag design, all operations must be tested. In general, an empty ADT Bag is created, and then, fill the bag, display the list and test other operations. It is not efficient to write everything in main. Method main should be small and the only method in a driver program. A helper class should be created to assist the driver. In the Helper class, minimum three static methods should be included. Method start creates an empty bag and is decomposed/calls other methods such as create and display. Method create should add items into the bag. Method display should display the items in the bag. More methods can be added to test other operations. Method main should call start from the driver program to start the entire testing process. Test the entire design by creating a driver program and a helper class of the driver program. • Create a helper class. In the helper class, minimum three static methods should be included. public class Helper //method 1 public static void start ) This void method is decomposed. It creates an empty bag. It calls create with a reference to the empty bag create adds a list of items into the bag It calls display with a reference to the bag. display displays the list of items in the bag. 1/method 2 public static returnypeOrvoid create a reference to a bagi Using data stored in text files to make items. Add the items into the bag. Note: In this case, you may add String objects to an ADT Bag that can store items of Object type. //method 3 public static returnTypeOrvoid display (A reference to a bag) Displays the list of items in the bag. • Create a driver program. In main of the driver program, call method start to start the entire testing process. public class Driver public static void main(String[] args) Helper.start(): The sample testing file may contain items like this: Apple Pear Orange Milk Bread The path for this file should not start from a specific folder on your computer. It should start from the default folder. When grading the project, the testing file is expected in the default folder of the Java project in Eclipse. Documentation: Complete all other documents needed.

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with My Study Writers
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
History
Looks great and appreciate the help.
Customer 452675, April 26th, 2021
History
Thank you. No issues
Customer 453139, April 17th, 2022
Nursing
Impressive writing
Customer 452547, February 6th, 2021
Health Care
awesome work
Customer 452777, October 14th, 2021
Social Sciences
Very fast report with excellent information on the topic. Thank you for your speedy service in such a short time.
Customer 453213, June 15th, 2022
Education
N/A
Customer 453057, May 23rd, 2022
Management
It's the second time I use this service and it does not let me down. Work quality is so good for its price!
Customer 452985, December 3rd, 2021
Psychology
Received before the deadline. Great job!
Customer 453027, January 15th, 2022
Accounting
Looks amazing!
Customer 453283, September 2nd, 2022
English 101
IThank you
Customer 452631, April 6th, 2021
Psychology
Thank you!
Customer 452545, February 6th, 2021
Human Resources Management (HRM)
On time and as always a great service! This semester has been very time consuming a tough for my family so this service has not only been a life saver but helped me keep up my grades! If you are in a time crunch or need help, don't hesitate! They are worth it!
Customer 453077, April 4th, 2022
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat
Live ChatWhatsApp