answers correctly solved 2025
Which pseudocode statement displays the first character in the String variable
str?
a. Display str[1]
b. Display str[0]
c. Display str[first]
d. Display str - correct answer Display str[0]
Which pseudocode statement displays the last character in the String variable
str?
a. Display str[-1]
b. Display str[length(str)]
c. Display str[last]
d. Display str[length(str) - 1] - correct answer Display str[length(str) -1]
If the str variable contains the string "berry", which pseudocode statement
changes its contents to "blackberry"?
a. Set str[0] = "black"
b. Set str = str + "black"
c. insert(str, 0, "black")
d. insert(str, 1, "black") - correct answer insert(str,0,"black")
If the str variable contains the string "Redmond", which pseudocode statement
changes its
contents to "Red"?