Consider the linkedBag as discussed in chapter 4 which is derived from BagInterface as discussed in chapter 1 of text. Write C++ code to do each of the following: Implement a new bool member function...


Consider the linkedBag as discussed in chapter 4 which is derived from BagInterface as discussed in chapter 1 of text.





Write C++ code to do each of the following:





  1. Implement a new bool member function named smallest which is declared in public area of linkedBag class as shown below. (30)




bool smallest (ItemType & result);





  1. Declare a bag object of char type named aBag and then then read 20 chars into aBag (from cin). (15)





  1. Ask the user to enter a char and delete that letter from aBag. Print a message indicating whether the deletion is successful or not. (15)





  1. Print the smallest element from aBag by using the member function smallest. (10)





  1. Print the largest element from aBag Since the linkedBag do not the largest function, you must use other means to achieve this. (20)

Sep 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here