Grade ared as either string& or 1. For each function below indicate whether the
ID: 3892813 • Letter: G
Question
Grade ared as either string& or 1. For each function below indicate whether the string parameter would be best decl const string& a. A void function that takes a string parameter that it modifies changing the spaces to A bool function that takes a string parameter and returns true if all characters in the string are let Z and a-z) b. 2. Consider the following statements: string a = "ABCDEFGH lJKLMNOPQRSTUVWXYZ"; string b: After the sttement b-a. substr ( 3, 3 ) ; executes, the value of b s "--". c. ABC d. DEF 3. Louie expected that the following code would change the white spaces in name to equal signs (,but it didn 't seem to work. string name "Mary Smith" i if (isspace(name[ i])) //Line 1 //Line 2 //Line3 //Line 4 //Line 5 for (un signed int i - e;Explanation / Answer
1a. string& because you wont be able ro change the content of the string otherwise.
1b. const string& because you dont need to make any changes to the string supplied.
2. value of b is "D"
3. line 4 needs to be changed.
name[i] = "=";
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.