Question: c++ This activity is based on bag implementation using new operator (BagDynMem Alloc.cpp) Your tasks are to modify BagDyn() class given in BagLinked_List.cpp, to allow

 c++ This activity is based on bag implementation using "new" operator
c++

This activity is based on bag implementation using "new" operator (BagDynMem Alloc.cpp) Your tasks are to modify BagDyn() class given in BagLinked_List.cpp, to allow up to three duplicates of same item. Initially create a bag with the capacity of 10 items. Ask user to input an item to bag. If the count of curretn item is already three, then do not add this item to the bag. A sample run given below. A bag with capacity of 10 is ready... Enter a number: 5 > 5 Enter a number: 3 >5,3 Enter a number: 5 > 5, 3,5 Enter a number: 7 >5,3,5,7 Enter a number: 5 > 5, 3, 5, 7,5 Enter a number: 5 Bag has already three 5s. > 5,3,5,7,5 Enter a number: 1 > 5, 3, 5, 7,5,1 Enter a number: 0 > 5, 3, 5, 7, 5, 1,0 Enter a number: 0 > 5, 3, 5, 7, 5, 1, 0, 0 Enter a number: 0 > 5, 3, 5, 7, 5, 1, 0, 0, 0 Enter a number: 0 Bag has already three Os. >5,3,5,7,5,1,0,0,0

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