Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2000 Database Design

Authors: Louis Davidson

1st Edition

1861004761, 978-1861004765

More Books

Students also viewed these Databases questions