Answered You can buy a ready-made answer or pick a professional tutor to order an original one.

QUESTION

hopping List Implement a List ADT for storing a list of shopping items. The class must be named ShoppingList and must be implemented using a dynamic array. Set the default array size to 4 (in the de

hopping List Implement a List ADT for storing a list of shopping items. The class must be named ShoppingList and must be implemented using a dynamic array. Set the default array size to 4 (in the default constructor). Three of the member functions will be implemented recursively. Reading in Items You should read in a list of items to add to the shopping list from items.csv using file I/O. Do NOT hard code any data except for the filename. Initialize a ShoppingList and add items until you reach the end of the file. The first column is the name of the item and the second column is the index that the item should be added at. Check the PA 2 instructions on Canvas for more information on file I/O. Operations Implement basic class functions (default and copy constructors, destructor, copy assignment) and the basic list functions (insert, remove, getSize). insert(string s, index i): if there is an item at index i already, make space for the new item by shifting all the items to the right and place the new item at index i. If index i is out of range, print a warning and place the new item at the end of the array. Resize accordingly. remove(index i): returns the item at index i and removes it from the array. Use a recursive helper function to shift elements to the left. Ex. arr = [a,b,c,d,e,f,_ ] remove(2); //returns c arr = [a,b,d,e,f,_,_ ] getSize(): returns the number of items in the list. Also implement two recursive functions below. You can use helper functions as needed. 1. printList(): recursively prints all items on the shopping list (example provided on the next page). 2. findItem(string item): recursively counts and returns how many elements in the array are item.  

The CardStack class should be in two files named shopping.h and shopping.cpp. The driver should be in a file named pa2.cpp. EXECUTION EXAMPLE Your class files should support tests such as these: ShoppingList s = ShoppingList(); //code for reading in items.csv s.printList(); arr[0]: banana arr[1]: water arr[2]: chair arr[3]: desk arr[4]: watch arr[5]: pen arr[6]: banana arr[7]: eraser cout << s.remove(1) << " has been removed." << endl; prints water has been removed. Printing after remove arr[1] arr[0]: banana arr[1]: chair arr[2]: desk arr[3]: watch arr[4]: pen arr[5]: banana arr[6]: eraser There are 7 items on the list. There are 2 banana(s) on the list.  

/// sample for item.csv file 

item,indexbanana,0chair,1desk,2banana,3water,1pen,4eraser,8watch,4

Show more
Dr. Protus
Dr. Protus
  • @
  • 23 orders completed
ANSWER

Tutor has posted answer for $70.00. See answer's preview

$70.00

***** ****** **** the ***** ******** ******* A kind ******** ****** ****** and leave ****** **** ******** remarks ***** you ******* the ***** ***** ***

Click here to download attached files: ShoppingList.docx
or Buy custom answer
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question