Create the function definition named maxAlphaSum . As shown in the example code below, the maxAlphaSum
Fantastic news! We've Found the answer you've been seeking!
Question:
Create the function definition named maxAlphaSum. As shown in the example code below, the maxAlphaSum function returns the index to the string in a passed array that has the highest sum based on the alphaSum function. Assume the alphaSum function that is passed a string and returns an unsigned integer is available to call. in C++
const unsigned SIZE = 3;
std::string strArr[SIZE];
strArr[0] = "Today is a good day to do good.";
strArr[1] = "Nobody likes coffee like that!";
strArr[2] = "Robot Monster was better than Star Wars!";
size_t min = maxAlphaSum(strArr, SIZE);
std::cout << "Based on the alphaSum function, the string ""
<< strArr[min] << "" has the highest value.";
Related Book For
Posted Date: