Question 1
OCR Computer Science June 2018 Paper 2GCSE11 marks
On the specification
- (a)
- 2.2 Programming techniques
- (b)(i)
- 2.2 Programming techniques
- (b)(ii)
- 2.2 Programming techniques
- (c)
- 2.1 Algorithms2.2 Programming techniques
Question text
1 OCR High School uses a computer system to store data about students’ conduct. The system records good conduct as a positive number and poor conduct as a negative number. A TRUE or FALSE value is also used to record whether or not a letter has been sent home about each incident. An example of the data held in this system is shown below in Fig. 1: StudentName Detail Points LetterSent Kirstie Homework forgotten −2 FALSE Byron Good effort in class 1 TRUE Grahame 100% in a test 2 FALSE Marian Bullying −3 TRUE Fig. 1 (a) State the most appropriate data type used to store each of the following items of data. • StudentName • Points • LetterSent [3] (b) The data shown above in Fig. 1 is stored in a database table called Conduct. (i) Write an SQL statement to select the StudentName field for all records that have negative Points. [3] (ii) State the wildcard that can be used in SQL to show all fields from a table. [1] (c) A single record from this database table is read into a program that uses an array with the identifier studentdata. An example of this array is shown below: studentdata = [“Kirstie”, “Homework forgotten”, “-2”, “FALSE”] The array is zero based, so studentdata[0] holds the value “Kirstie”. Write an algorithm that will identify whether the data in the studentdata array shows that a letter has been sent home or not for the student. The algorithm should then output either “sent” (if a letter has been sent) or “not sent” (if a letter has not been sent). [4]