Help me with this work
The following 3 methods are to be added to the Array-based implementation of the Bag ADT (ArrayBag.h and ArrayBag.cpp). Methods must compose a new Bag object by accessing the elements of the underlying array of the Bag objects. You may not convert the Bags to vectors in the completion of these methods. The main method must also be updated to thoroughly test the newly added methods. Your output does not need to match the samples shown. Note: Remember that the ArrayBag is a template, not an actual class. The last line of ArrayBagh should say: #include "ArrayBag.cpp". Therefore, ArrayBagcpp cannot be added to the project; you can open it in the NetBeans editor from the File tab. 1) bagUnion: The union of two bags is a new bag containing the combined contents of the original two bags. Design and specify a method union for the ArrayBag that returns as a new bag the union of the bag receiving the call to the method and the bag that is the methods parameter. The method signature (which should appear in the .h le and be implemented in the .cpp le is: ArrayBag
bagUnion(const ArrayBag &otherBag) const; This method would be called in main() with: ArrayBag baqluZ = baq1.bagUnion(bag2); Note that the union of two bags might contain duplicate items. For example, if object x occurs ve times in one bag and twice in another, the union of these bags contains x seven times. The union does not affect the contents of the original bags. Example run: First bag: The bag contains 5 items: 1 2 3 9 5 Second bag: The bag contains 5 items: 20 30 10 50 1 The bag containing the union or these bags: The bag contains 10 items: 1 2 3 4 5 20 30 40 50 1 First bag: The bag contains 5 items: one two three four five Second bag: The bag contains 5 items: twenty thirty tourty titty one The bag containing the union of these bags: The bag contains 10 items: one two three four five twenty thirty fourty fifty one