Question 1

AQA Computer Science June 2024 Paper 1A (8525/1A)GCSE6 marks

On the specification

1.1
3.2 Programming
1.2
3.2 Programming
1.3
3.2 Programming
1.4
3.2 Programming
1.5
3.2 Programming
Question text

1 Figure 1 shows an algorithm, represented using pseudo-code. The algorithm assigns different values to two variables, then asks the user to input a letter. Figure 1 film  "Godzilla vs. Kong" year  2021 OUTPUT "Please guess a letter" letter  USERINPUT 1.1 Which pseudo-code statement assigns the length of the string film to a variable called value? Shade one lozenge. [1 mark] A film  LEN(value) B film  film + value C value  film D value  LEN(film) 1.2 The POSITION subroutine returns the position of the first occurrence of a character in a string. For example: • POSITION("Godzilla vs. Kong", "o") would return 1 • POSITION("Godzilla vs. Kong", "z") would return 3 letter and film are variables used in the algorithm in Figure 1. Complete the pseudo-code statement to find the position of the first occurrence of the contents of letter in film and store this position in the variable location You must use the POSITION subroutine in your answer. [1 mark] location  1.3 Which of the following would be the most suitable data type for the variable year? box Shade one lozenge. [1 mark] A Boolean B character C integer D real 1.4 Describe what is meant by an assignment statement in a program. [1 mark] 1.5 Write a C# program that: box • gets the user to enter the name of a film • displays You entered followed by the name of the film entered by the user. The output from the program must be on one line. You should use meaningful variable name(s) and C# syntax in your answer. The answer grid below contains vertical lines to help you indent your code accurately. [2 marks]