Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a c++ program that stores words in an STL vector and then searches the vector for words. Requirements You will keep track of strings

Create a c++ program that stores words in an STL vector and then searches the vector for words.

Requirements You will keep track of strings as C++ string objects.

In main, declare a vector variable to contain your strings.

Create a loop that gets one word at a time from the user until they enter "." as the only thing on the input line. For this assignment, it is adequate to limit strings to one word at a time. Put the word into the vector.

Once the user is done entering words, set up a separate loop to search for words in the vector. Similar to the previous loop, get the searchable words one at a time until they enter ".". When you find the word, use printf() (or cout) to display "Success!". If you don't find the word, use printf() (or cout) to display "Not there!".

You should comment as normal.

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

More Books

Students also viewed these Databases questions