Question: Programming Assignment Week 10 In this project you will implement the ADT Bag in Java using Vectors instead of Arrays. Recall that our ADT Bag

 Programming Assignment Week 10 In this project you will implement the

Programming Assignment Week 10 In this project you will implement the ADT Bag in Java using Vectors instead of Arrays. Recall that our ADT Bag had the following sample interface. package cam. example .hagdemo ; public interface BagInterfaoe { int getCurrentSizeU: // get size of bag boolean isEmptyU; ,0\" return whether emty boolean add {Object item]: // add generic item boolean remove (Object item) ;/g" remove specific item if present boolean removeU: // remove random item void. clear\" : // empty bag Objectl] tohrraytl : // return an array of objects from bag 1. Create a project with a common package and three files, separating interface from implementation and use. One of your files will be hosting the Main class which you can use to test and debug your project. 2. Implement the given BagInterface in a class VectorBag. This class will not have a static size (n), but you will allow it to grow dynamically. Recall that we collect arbitrary objects, so you need to use Vector instead ofobject as we did in lecture. The length of a vector is tested with the size() method. To add elements, use the add\" method. To remove an element from a vector, use the remove (3 method. It seamlessly adjusts entries, so you do not need to move subsequent items. 3. Test and debug your project. You will be graded on the correctness of your program. 4. Submit by uploading them as .java

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 Programming Questions!