Lesson 4.1.1.7
4.1.1.7 String-handling operations Quiz: AQA Computer Science, Unit 1
20 questions
In partnership with Revision Ninja
Lesson 4.1.1.7, String-handling operations: 20 multiple choice questions for the AQA Computer Science (7517), Unit 1: Fundamentals of programming, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
Which string-handling operation returns the number of characters in a string?
- length
- substring
- position
- concatenation
-
Which operation joins two strings end to end?
- Substring, which extracts a section of characters starting at a chosen position
- Concatenation
- Position, which finds where one string starts within another string
- Length, which counts the number of characters that a string contains
-
Which operation returns part of a string, starting at a given position and of a given length?
- Length
- Character code
- Concatenation
- Substring
-
What does a character-to-character-code operation return for the character A in ASCII?
- 1
- 97 in every character set
- 65
- A
-
Which operation converts a character code such as 66 back to its character?
- Character to character code
- Integer to string
- Character code to character
- String to integer
-
Which conversion turns the string "42" into the integer 42?
- String to float
- Date/time to string
- Integer to string
- String to integer
-
Which operation returns the position of a character or substring within a string?
- Float
- Length
- Concatenation
- Position
-
What is the length of the string "Quiz Rush" including the space?
- 8
- 7
- 9
- 10
-
Given the string "computer", what does substring(1, 4) return when the first character is at position 1 and the length is 4?
- ompu
- uter
- comp
- compu
-
What is the result of concatenating "Rev" with "ision"?
- Revision
- Revi sion
- Reviision
- Rev ision
-
Which conversion turns the integer 250 into the string "250"?
- String to float
- String to integer
- String to date/time
- Integer to string
-
Which conversion turns the string "3.5" into a real value?
- Character to character code
- Integer to string
- Float to string
- String to float
-
Which conversion produces the text 2024-03-15 from a date value?
- Date/time to string
- Integer to string
- String to date/time
- Float to string
-
A program receives the text "12A" from a keyboard and tries to convert it to an integer. What is the most likely outcome?
- The value 0 with no error
- The value 12 with the letter ignored automatically
- An error, because the text is not a valid whole number
- The value 12A stored as an integer
-
Which code is returned by the character-code operation for the character a if the character set is ASCII?
- 65
- 98
- 97
- 1
-
A program uses substring to extract the first 3 characters of a product code "AB1234" and then concatenates "XY" to the result. What is the new string?
- AB1XY
- ABXY1
- XYAB1
- ABXY
-
A program stores the string "Level" and wants to test whether a word is a palindrome by comparing it with its reverse. Which string operations are most needed?
- Length, substring and a comparison
- Only a date/time conversion
- Only the position of the first space
- Only concatenation with a float
-
Why is a string-to-integer conversion needed before adding two numbers entered as text?
- The language does not support addition of any kind, so the values must be joined instead
- Integers are always stored as strings in memory, so the conversion makes no real change
- Text values cannot be added as numbers without first converting them
- Addition only works with strings, so numbers entered as text must be stored separately
-
Which string operation would most directly find the first space in a sentence so the first word can be extracted?
- Position
- Character to character code
- Length
- Float conversion
-
The string "ABCDE" is processed by substring(3, 2). What is returned?
- ABC
- DE
- BC
- CD
Related quizzes
- Data types Quiz · 4.1.1.1 · 20 questions
- Programming concepts: sequence, selection and iteration Quiz · 4.1.1.2 · 20 questions
- Arithmetic operations Quiz · 4.1.1.3 · 20 questions
- Relational and Boolean operations Quiz · 4.1.1.4 · 20 questions
- Constants and variables Quiz · 4.1.1.6 · 20 questions
- Random numbers and exception handling Quiz · 4.1.1.8 · 20 questions
- Subroutines Quiz · 4.1.1.10 · 20 questions
- Parameters and returning values Quiz · 4.1.1.11 · 20 questions
- Local and global variables Quiz · 4.1.1.13 · 20 questions
- Stack frames in subroutine calls Quiz · 4.1.1.15 · 20 questions