NOTE: This is a hard deadline so that the solution can be posted and discussed during the Final Review Session on Monday March 19th during the normal class time. NO LATE ASSIGNMENTS will be accepted.
Implement the following nested menu programs using the STL versions of list and vector. Options on the main menu give access to the sub-menus. For this assignment, use the following main menu:
Welcome to the CS222 Homework 7 Menu ========================================== 1. Test the vector STL with integers 2. Test the vector STL with doubles 3. Test the list STL with integers 4. Test the list STL with characters 0. Exit ==========================================The submenus are defined as follows.
STL Vector Sub-Menu ************************************************************************ 1. Print the capacity and size of the vector 2. Clear all the elements on the vector 3. Add an element to the end of the vector 4. Remove the last element from the vector and print its value 5. Use the index operator to set and print the value of an element 6. Use the reserve function to change the number of elements allocated 7. Use the resize function to change the number of elements in use 8. Search for a given value in the vector using STL find() 9. Print the current contents of the vector using the [] operator 0. Return to the main menu ************************************************************************Create a vector object of the type the main menu() selected and use the vector interface to perform these actions. Create iterators when appropriate to perform operations (such as for option 8).
Linked List Sub-Menu +++++++++++++++++++++++++++++++++++++++++++++++++ 1. Insert a value at the front of the list 2. Insert a value at the back of the list 3. Insert a value at a given position in the list 4. Search the list for a value 5. Delete all instances of a value 6. Print the list contents 0. Return to main homework menu +++++++++++++++++++++++++++++++++++++++++++++++++Again, create a list object of the type the main() menu selected and use the list interface to perform these actions. For options 3 and 4, use iterators for the positions and search results.
Code all of this in one file called hw7.cpp. Email me whatever you have completed by the deadline to get partial or full extra credit. NO LATE ASSIGNMENTS WILL BE ACCEPTED.