Question 6
OCR Computer Science June 2024 Computational thinking, algorithms and programming (J277-02)GCSE6 marks
On the specification
- (a)
- 2.2 Programming fundamentals
- (b)
- 2.2 Programming fundamentals
Question text
6 The variable message is assigned a value. message = "abcd1234" (a) Complete the table to show the output when each statement executes. The first output has been completed for you. Statement Output print(message.length) 8 print(message.upper) print(message.left(4)) print(int(message.right(4))*2) [3] (b) Write an algorithm in pseudocode to: • store "Hello" in the variable word1 • store "Everyone" in the variable word2 • concatenate word1 and word2 to store "HelloEveryone" in the variable message [3]