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.

Host this setFree Play

The 20 questions

  1. Which string-handling operation returns the number of characters in a string?

    • length
    • substring
    • position
    • concatenation
  2. 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
  3. Which operation returns part of a string, starting at a given position and of a given length?

    • Length
    • Character code
    • Concatenation
    • Substring
  4. What does a character-to-character-code operation return for the character A in ASCII?

    • 1
    • 97 in every character set
    • 65
    • A
  5. 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
  6. Which conversion turns the string "42" into the integer 42?

    • String to float
    • Date/time to string
    • Integer to string
    • String to integer
  7. Which operation returns the position of a character or substring within a string?

    • Float
    • Length
    • Concatenation
    • Position
  8. What is the length of the string "Quiz Rush" including the space?

    • 8
    • 7
    • 9
    • 10
  9. 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
  10. What is the result of concatenating "Rev" with "ision"?

    • Revision
    • Revi sion
    • Reviision
    • Rev ision
  11. Which conversion turns the integer 250 into the string "250"?

    • String to float
    • String to integer
    • String to date/time
    • Integer to string
  12. Which conversion turns the string "3.5" into a real value?

    • Character to character code
    • Integer to string
    • Float to string
    • String to float
  13. 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
  14. 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
  15. Which code is returned by the character-code operation for the character a if the character set is ASCII?

    • 65
    • 98
    • 97
    • 1
  16. 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
  17. 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
  18. 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
  19. 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
  20. The string "ABCDE" is processed by substring(3, 2). What is returned?

    • ABC
    • DE
    • BC
    • CD

All AQA Computer Science quizzes