Question: C++ /* Write code for void function display_vector that accepts parameter const reference vector of strings. The function will iterate through the vector and display

C++

/* Write code for void function display_vector that accepts parameter const reference vector of strings. The function will iterate through the vector and display a string per line. */

Write code for void function update_vector_element that accepts parameter reference vector of strings, a string vector search_value, and a string replace_value. The function will iterate through the vector and search for the search_value and if found will replace the vector element with the replace_value. */

Write code to create a vector of string names, add the values "John", "Mary", "Patty",

"Sam" to the vector, call the function display_vector and pass the names vector as

an argument, prompt user for a name to search for and a value to replace searched value with.

Afterward, call the update_vector_element with the names vector and call the display_vector function.

Don't worry about displaying a message for values that aren't found. Assume user will give you a valid name.

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!