Question: Questions to Answer to use vectors a lot in this course. Create an EASY main program that does the following: creates gs representing a grocerylist.

 Questions to Answer to use vectors a lot in this course.

Questions to Answer to use vectors a lot in this course. Create an EASY main program that does the following: creates gs representing a grocerylist. Has the user enter as many strings as they would like to add to 1. We are going a vector of strin he vector for their grocery list. Then it should print allthe items in the list (so print all the items in the vector). y pretend the user got to the cashier and didn't have enough money and decided to remove the last item from the list. Remove the last item and then print the list again. Post your code here. Remember the goal is NOT perfect code on these discussion boards, i you are unsure post what you have and let another student help you out 2. Write a FUNCTION TEMPLATE (note it says function template NOT class template) called hastem that finds out of an item is in an array and returns true if the item is in the array and false otherwise. So if it was an array if ints (and not a template) the prototype might look like this bool hasitemlint arrll int itemToFind); HOWEVER since this is a function template it should work for ANY type f array (an array of doubles, an array of strings etc) .so your goal is to write a template for the hasltem function that works on an array of any data type, If you are stuck look at the slides there is a function template for a square function that could help. Remember again the goal is NOT perfect code on discussion boards, if you are unsure post what you have and let another student help you out

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!