Class Activity Strings
Class Activity Strings
a) string concatenation
b) string traversal
c) string formatting
d) string slicing
3 Which of the following is the process of joining two or more or strings together? (1)
a) string concatenation
b) string traversal
c) string formatting
d) string slicing
4 Which of the following is the index of the letter ‘o’ in the string ‘Edexcel Examinations
Board’? (1)
a) 23
b) 18
c) 17
d) 22
6 Complete the following algorithm to concatenate the variables in lines 1 and 2 to produce a
message welcoming the user. (2)
1 RECEIVE firstName FROM (STRING) KEYBOARD
2 RECEIVE surname FROM (STRING) KEYBOARD
3 SEND firstName , surname TO DISPLAY
© Pearson Education Ltd, 2020. Copying permitted for purchasing institution only. This material is not copyright free.
7 A student used the following line in an algorithm:
It did not give the expected result. Explain why and write a correct version. (2)
It didn’t give a correct result as the student made it a string instead of a variable, the outut
would be – please enter the person’s name – and that’s it, not letting the user input their
name. the correct pseudocode would be:
SET name TO “ “
SEND “Please enter the person’s name” TO DISPLAY
RECEIVE name FROM (STRING) KEAYBOARD
Task 2
The string
Text = Computer Science
Paste the code into your VEB book under the title “Strings”
© Pearson Education Ltd, 2020. Copying permitted for purchasing institution only. This material is not copyright free.