Title: Module 12 Quiz (Ungraded)
Course: COP 1510 Programming Concepts > Section: Module 12 - Text Processing

Q: What is the output of the following pseudocode?
- A
- B
- C
- ABC
- Nothing. This is an error.
A: B

Q: Assuming the following variable declaration,

which of the following pseudocode statements displays the last character in the string?
- Display str[0]
- Display str[3]
- Display str[length(str)]
- Display str[length(str) - 1]
- None of these
A: Display str[length(str) - 1]

Q: Assuming the following variable declaration,

which of the following pseudocode statements changes the variable's contents to "Mia"?
- delete(str, 3, length(str))
- delete(str, 3, 4)
- Set str = str - "mi"
- Set str[0] = "Mia"
- None of these
A: delete(str, 3, 4)

Q: If the following pseudocode were an actual program, what would it display?
- Good morning
- Goodmorning
- Good
- morning
- None of these
A: Goodmorning

Q: Assuming the following variable declaration,

which of the following pseudocode expressions will return True?
- isDigit(str[3])
- isDigit(str[4])
- isLetter(str[3])
- isWhiteSpace(str[7])
- None of these
A: isDigit(str[3])

Q: Assuming the following variable declaration,

which of the following pseudocode statements changes the variable's contents to "robot"?
- Set str[0] = "ro"
- Set str = str + "ro"
- insert(str, 0, "ro")
- insert(str, length(str), "ro")
- None of these
A: insert(str, 0, "ro")

Q: If the following pseudocode were an actual program, what would it display?
- +1+2+3+4+
- +1+2+3+4
- 1+2+3+4
- a+b+c+d+
- None of these
A: +1+2+3+4

Q: If the following pseudocode were an actual program, what would it display?
- vwxyz
- wxyz
- xyz
- uvwxyz
- None of these
A: xyz

Q: If the following pseudocode were an actual program, what would it display?
- yal
- roy
- al
- oya
- None of these
A: al

Q: If the following pseudocode were an actual program, what would it display?
- 3
- 0
- 5
- 4
- None of these
A: 4

Q: Assuming that a variable named ocean has been initialized with the string "Atlantic", which of the following library functions would return the first character in the string?
- length(ocean)
- toUpper(ocean)
- substring(ocean, 0, 0);
- contains(ocean, "A");
- None of these
A: substring(ocean, 0, 0);

Q: Which of the following programs work extensively with text?
- Word processors
- Test messaging programs
- Email applications
- All of these
- None of these
A: All of these

Q: Which of the following pseudocode statements uses substring notation to display the first character in a String variable named city?
- Display city[0]
- Display city[length - 1]
- Display city[1]
- All of these
- None of these
A: Display city[0]

Q: True/False: The isWhiteSpace library function returns True if its argument is displayed on the screen using a white background color.
- True
- False
A: False

Q: True/False: The insert library module automatically expands the size of the string to accommodate the inserted characters.
- True
- False
A: True

Q: True/False: Some programming tasks require that you access and/or manipulate the individual characters in a string.
- True
- False
A: True

Q: True/False: The stringToReal library function accepts a Real value as an argument and returns the String equivalent of the value.
- True
- False
A: False

Q: True/False: Most programming languages do not allow access to the individual characters in a string.
- True
- False
A: False

Q: True/False: The isUpper library function converts a character to uppercase.
- True
- False
A: False

Q: True/False: The expression isDigit("9") returns True.
- True
- False
A: True