Question: 1.add following function to the class Bag: bool getMax(int &maxItem) The function find the largest integer in the bag and return it through its parameter
1.add following function to the class Bag:
bool getMax(int &maxItem)
The function find the largest integer in the bag and return it through its parameter "maxItem". The function returns false if the Bag is empty, otherwise, the function returns true.
2.Write a program that uses rand() to randomly generate 30 integers between 0 and 9 and save them in an instance of class Bag without including any duplicated numbers in the bag.
// source file
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
