Question 8

AQA Computer Science June 2020 Paper 1GCSE7 marks

On the specification

8.1
3.3 Fundamentals of data representation
8.2
3.3 Fundamentals of data representation
8.3
3.1 Fundamentals of algorithms3.2 Programming3.3 Fundamentals of data representation
Question text

8 box The subroutine CODE_TO_CHAR can be used to convert a character code into the corresponding Unicode character. For example: CODE_TO_CHAR(97) will return the character 'a' CODE_TO_CHAR(65) will return the character 'A' The subroutine CHAR_TO_CODE can be used to convert a Unicode character into the corresponding character code. For example: CHAR_TO_CODE('a') will return the integer 97 CHAR_TO_CODE('A') will return the integer 65 8.1 Shade one lozenge to show what value would be returned from the subroutine call CODE_TO_CHAR(100) [1 mark] A 'c' B 'd' C 'e' D 'f' 8.2 State the value that will be returned from the subroutine call: CODE_TO_CHAR(CHAR_TO_CODE('E') + 2) [1 mark] Value returned 8.3 Write a subroutine TO_LOWER, using either pseudo-code or a flowchart, that takes an upper case character as a parameter and returns the corresponding lower case character. For example, if the subroutine TO_LOWER is passed the character 'A' as a parameter, the subroutine should return the character 'a'. You should make use of the subroutines CODE_TO_CHAR and CHAR_TO_CODE in your answer. You can assume that the parameter passed to the subroutine will be in upper case. [5 marks]