*Please utilize C++ format when answering questions 14. Write a function named a
ID: 3626491 • Letter: #
Question
*Please utilize C++ format when answering questions14. Write a function named avg_length that has a single vector parameter (vector of strings).
The function should calculate and return the average length of all the strings in the vector.
The function should return an average of 0.0 if the vector is empty.
For example, when the function is called, if the vector argument has the 4 string values,"hello", "hi", "goodbye", "adios"
the function should return an average length of 4.75.
(19 characters divided by 4 strings is 4.75 characters per string.)
Recall that the string class has a member function named length that returns the number of characters in the string object.
15. Write a test harness that tests the avg_length function you wrote for the previous
question. This must be a complete program, including all necessary include directives and
using statements.
To get all 10 points for this question, your test harness (main function) must be thorough.
This test harness must be capable of finding ALL potential errors in the logic of the
avg_length function (regardless of whether you actually have the logic errors in your
definition). A good strategy would be to write a test harness for testing someone else's
implementation of the avg_length function.
If you do not include all specific test values in your actual code, then you must state (in English is fine) what values you will enter for each test. I should be able to run your program
(entering the values you state, if applicable) and tell by the output if the function has a logic
or runtime error.