Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a linked list based bag implementations to maintain unsigned integers. You can modify the program under ( BagLinked _ List.cpp ) for this assignment.

Create a linked list based bag implementations to maintain "unsigned integers". You can modify the program under (BagLinked_List.cpp) for this assignment.
Your class should provide followings functionalities:
add(...)// insert new item to the bag
average(...)// returns average of the numbers of the bag
In the main() function, create a bag, then
Add 500 random numbers between 25 and 75,
Then add 500 random numbers between 125 and 175.
After adding each numbers, call average(...) and show the average of items of the bag so far added. This means you will add total of 1000 numbers and call average(...)1000 times to see average after each addition.
Note that this assignment should be implemented using linked lists as in BagLinked_List.cpp. Do not use any list or linked list library.
Submit a single compilable .cpp (no header, no screenshot, no readme please) file with the following format: "Lastname_FirstInitial_LastFourDigitsOfCWID_A2.cpp", such as Smith_J_5678_A2.cpp.
image text in transcribed

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions