Menu

[Solved]Include Code Create Class Shoppingcart Shoppingcart Contains Count Number Items Three Cate Q37201043

INCLUDE ALL CODE

Create a class, ShoppingCart.  EachShoppingCart contains a count of the number of items in each ofthree categories, produce, meats, others.  You willpopulate the counts of items in each category with the rand()function.  Produce with a range of 1 -10, meats with arange of 0 – 3 and other with a range of 1 – 30.  Youwill used the Queue or Dequeue templates from the STL to generate aqueue of 10 ShoppingCarts.  You then process thequeue.  Each item in the produce category will take 4seconds to process.  Each item in the meat category willtake 3 seconds to process.  Each item in the othercategory will take one second to process.  I suggest youinclude a method in ShoppingCart to report out the total processingseconds for an instance of a ShoppingCart based on the number ofitems in each category in that instance.  Your”processing” will consist of keeping track of the total processingtime for the entire queue.  When complete, report out thetotal time in hours, minutes and seconds.

Expert Answer


Answer to INCLUDE ALL CODE Create a class, ShoppingCart. Each ShoppingCart contains a count of the number of items in each of thre… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *