String Manipulation & Date/Time Objects is one of 10 topics in the Grade 11 Information Technology CAPS syllabus, covered across 3 lessons on Study Vault. Below are real practice questions from this topic with full worked answers.
Sample practice questions
Easy
1. What does determining the "length" of a string tell a program?
How many characters the string contains, including spaces and punctuation
Which character appears most frequently in the string
Whether the string contains only numbers
The exact date the string was created
Answer: How many characters the string contains, including spaces and punctuation — Determining the length of a string means finding out how many characters it contains, including spaces and punctuation.
Easy
2. What is a substring?
A smaller piece of text contained within a larger string
A string that only contains numeric digits
A string with no characters at all
A type of array used only for dates
Answer: A smaller piece of text contained within a larger string — A substring is a smaller piece of text contained within a larger string.
Medium
3. How many characters are in the string "Grade 11", counting the space as one character?
Answer: 8 — The string "Grade 11" contains G-r-a-d-e-space-1-1, which is 8 characters in total, including the space.