Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions