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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started