For this question write one function definition (You can dec…
For this question write one function definition (You can decide on the name of the function). Implement an integer function that will have two parameters, a string vector reference parameter called passWords and a character value parameter called lastCharacter. Inside the function declare, ask, and get a count from the user for the number of strings that will be entered. Use a do/while loop to ensure that the user will enter at least one passWord string, do not allow the user to enter 0 or a negative number for the count. Using the variable count, write a loop and continue to get strings from the user and add them into the string vector (passWords) that was passed to the function as a reference parameter. Assume the strings that the user enters are passWords (strings with no white space). Treat the passwords as normal strings entered with cin. After filling the vector with strings, loop through and count how many passWords in the vector end with the character lastCharacter. The character parameter lastCharacter could be any character: an upper case letter, lower case letter, digit, or special character. For example 123DOG (ends with ‘G’) is not the same as 123dog (ends with ‘g’), or 12DogX# ends with the character ‘#’. You want to count how many passWords were entered that end with the same character as lastCharacter and return that count. Do not change any characters in the vector to upper or lowercase. Do not change lastCharacter to upper or lowercase.
Read DetailsThere are three errors, what lines contain the errors and br…
There are three errors, what lines contain the errors and briefly explain the errors 0 int main()1 {2 int size;3 cout size;56 int *arr = new int(size);78 int sum = 0;910 for (int i = 0; i > arr[i];13 sum += arr[i];14 }1516 delete [ ]sum;1718 cout
Read Details