The pseudo-code in Figure 1 assigns two string values to two variables - AQA - GCSE Computer Science - Question 2 - 2021 - Paper 1
Question 2
The pseudo-code in Figure 1 assigns two string values to two variables.
Figure 1
title = 'computer science'
level = 'gcse'
2.1 Shade one lozenge that shows the l... show full transcript
Worked Solution & Example Answer:The pseudo-code in Figure 1 assigns two string values to two variables - AQA - GCSE Computer Science - Question 2 - 2021 - Paper 1
Step 1
Shade one lozenge that shows the length of the contents of the variable level in Figure 1.
96%
114 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
The length of the contents of the variable level is 4, as 'gcse' contains four characters. Therefore, you should shade lozenge D.
Step 2
Shade one lozenge that shows the result of concatenating the variable title with the variable level in Figure 1.
99%
104 rated
Only available for registered users.
Sign up now to view full answer, or log in if you already have an account!
Answer
Concatenating the variable title 'computer science' with the variable level 'gcse' results in 'computer science gcse'. Thus, you should shade lozenge A.