Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Impedance the following function given this function prototype: int maxASCIIStri

ID: 3684246 • Letter: I

Question

Impedance the following function given this function prototype: int maxASCIIStringPosition(vector input_strings); where input_strings is a vector of strings to be processed. If the vector is empty. The maxASCIIStringPosition function should return the index of the vector containing the string with the largest sum ASCII values. For example maxASCIIStringPosition(["abc", "bcd", "aaa"]) should return 1 because the sum of 'b', 'c', 'd' is greater than the other two strings. Assume ["abc"....] is a vector in this example.

Explanation / Answer

Answer:

int maxASCIIStringPosition(vector<string> input_strings)
{
   int len=0;
if(input_strings=="")
return -1;
else
len = strlen(input_strings);
    for (i = 0; i < len; i++)
    {
        sum = sum + input_strings[i];
    }
return sum;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote