Higher Computing Science CS(H)14AMS

National
Qualifications
CS(H)15AMS / Computing Science
Marking Instructions

© 2014 Perfect Papers – All rights reserved

General Marking Principles for Higher Computing Science

This information is provided to help you understand the general principles you must apply when marking candidate responses to questions in this Paper. These principles must be read in conjunction with the detailed marking instructions, which identify the key.

(a) Marks for each candidate response must always be assigned in line with these General Marking Principles and the Detailed Marking Instructions for this assessment.

(b) Marking should always be positive. This means that, for each candidate response, marks are accumulated for the demonstration of relevant skills, knowledge and understanding: they are not deducted from a maximum on the basis of errors or omissions.

(c) Marks should be awarded regardless of spelling as long as the meaning is unambiguous.

(d) Candidates may answer programming questions in any appropriate programming language or pseudocode. Marks should be awarded, regardless of minor syntax errors, as long as the intention of the coding is clear.

(e) Where a question asks the candidate to describe, the candidate must provide a statement or structure of characteristics and/or features. This should be more than an outline or a list. It may refer to, for instance, a concept, process, experiment, situation or facts in the context of, and appropriate to, the question. The candidates will normally be required to make the same number of factual/appropriate points as are awarded in the question.

(f) Where a question asks the candidate to explain, marks should only be awarded where the candidate goes beyond a description, for example by giving a reason, or relating cause to effect, or providing a relationship between two aspects. These will be related to the context of the question or a specific area within a question

Number / Question / Instructions / Marks /
1 / Paul has typed this line of code in his program.
(see paper)
When the code is translated his translation software displays this message:
“Error found on Line 201: incomplete statement, end of line found - ; expected”
State the type of programming error that Paul has made. / Syntax (1 mark) / 1
2 / Programs make use of parameter passing. Explain the difference between passing a parameter by reference and passing a parameter by value. / By reference:
·  Changes made to parameter are retained when subprogram finishes.
·  Parameter is passed in and out of subprogram.
Any one for 1 mark
By Value:
·  Parameter is copied when passed.
·  Updates are discarded when subprogram terminates.
Any one for 1 mark
Also accept:
·  By reference passes pointer to parameter in memory (1 mark) / 2
3 / A section of code has been written which examines an array of fifty values.
a / State the name of the standard algorithm which is shown above. / Finding Maximum (1 mark) / 1
b / When this program is run, the value for top is held in a register. Other than storing a piece of data, state another item that a register could hold. / ·  Memory Address
·  Instruction
·  Flag/Logical result of comparison/calculation
Any one for 1 mark / 1
4 / Explain the term function. / ·  A function is a subprogram which returns a single value.
·  The function name can be used in an assignment or conditional statement in the same way as a variable.
·  Parameters passed to a function are not (normally) returned*.
One mark each bullet, max 2 marks / 2
5 / This image of a cat is stored in 256 shades of grey.

Explain how this image would be stored as a bit-mapped graphic. / ·  Image is stored as grid of pixels
·  Each pixel has a binary value
·  Image will use an 8-bit palette of colours (because it has 256 colours)
1 mark for each bullet, max 3 marks / 3
6 / In the design of electronic documents it is important to separate the formatting of the document from the structure of the document. Explain how this is achieved in web page design. / ·  HTML provides the structure of the document/content.
·  CSS rules (in attached CSS file) provide formatting information for the tags/styles (in the document structure).
1 mark each bullet, max 2 marks / 2
7 / A sports shop has a database. A table in the database is shown below. (see paper)
State a suitable compound primary key for this table. / Item_code (1 mark) and category (1 mark)
Note: This is only unique combination. Award 1 mark for a single part of key with incorrect other attribute. A single part of key with no other attribute is 0 marks as question requests compound key. / 2
8 / Explain how usability testing would be used in the design of a new mobile phone interface. / ·  Users would be given devices with new interface and directly observed as they used the devices.
·  Users are provided with a realistic situation and asked to perform tasks using the devices that relate to this.
·  Users may be asked to complete pre and post questionaries to gather feedback.
·  Feedback may also include thinking-aloud protocol/eye tracking/co-discovery learning.
·  Other valid
1 mark each bullet, max 2 marks
Note: gathering opinions is not usability testing. Usability testing involves systematic observation under controlled conditions. / 2
9 / Describe a typical phishing attempt. / User receives communication from what looks like a trust worthy source (1 mark) which requests sensitive information (passwords, usernames, banking details). (1 mark).
Accept responses that focus specifically on email spoofing. / 2
10 / a / State the meaning of the term open source. / ·  Open source software is shared with all users using a universal free access license.
·  The source code is open and shared with all users.
·  Open source is a model of software development based on peer collaboration and open access to code.
1 mark for one bullet / 1
b / Other than cost of licensing, state an advantage of using open source software rather than proprietary software. / ·  Frequent updates provide by community.
·  Frequent testing/identification of security flaws.
·  Ability to modify/fork code (build own versions of applications).
·  Other valid
1 mark for one bullet / 1
11 / A program has been written to find the location of a requested value in a list, however the program does not return the correct location. The algorithm responsible is shown below. (see paper)
a / Line 1 shows the use of a 1-D array to store the list of values, rather than eight individual variables. Design two advantages of using a 1-D array to store the list of values. / ·  only one line of code required to create multiple values
·  can be traversed using loop structure
·  parameter passing easily implemented with one line
·  efficiency of code
·  each individual element in the array can be referenced by indexing
1 mark each bullet, max 2 marks / 2
b / A trace table is being used to record the changes to variables when stepping through the code.
(Line 5 does not change a variable’s value and so it not included.) (see paper)
i / Complete the information in the table above, recording the value assigned to the variable for line 2, 3, 4 and 6. / Line / dataset / find / location / counter / 3
1 / [72,34,19,73,52,28]
2 / 99
3 / 72
4 / 1
6 / 99
4 correct values for three marks, 3 for 2 marks and 2 for 1 mark.
ii / Explain why the location is never correctly given. / (Line 6) sets the counter to the location value that will result in the location being given as 99 (1 mark).
The loop will also terminate prematurely (because the counter is greater than 6) (1 mark) / 2
iii / Describe how the algorithm should be corrected. / Line 6 should be changed to (1 mark)
SET location TO Counter (1 mark) / 2
c / i / The program is halted at line 4 to allow it to be debugged. State the feature of the software development environment that allows a program’s execution to be halted. / Breakpoints (1 mark)
Accept “Break on watch value” and other similar debugging features. / 1
ii / Describe how halting the execution of the program will assist with finding errors in the program. / ·  Values of variables can be inspected to determine issues.
·  Ability to step-into/step over code to assess effect.
·  Program flow/logic can be inspected.
·  Other valid.
1 mark each bullet, max 2 marks / 2
12 / Gordon is a computing science teacher and is creating a program that delivers a multiple-choice test to his pupils. The test will contain thirty questions and each question has only one correct answer.
The test is created in a text file and a sample from the file is shown below: (see paper)
a / Gordon creates a record data structure for each question.
i / Define a suitable record for a question. / RECORD TYPE question
STRING: question_text
STRING: option_a
STRING: option_b
STRING: option_c
STRING: option_d
STRING: answer
END RECORD
1 mark for start/end record
2 marks for 6 correct types and names
Max 3 marks / 3
ii / Declare a variable that can store the thirty questions. / ARRAY[30] of question
1 mark for array and size
1 mark for generating an array of records / 2
b / When running the program an error occurs when reading the file.
State one example of an execution error that could occur when reading the text file. / ·  Reading past end of file
·  Attempting to read an empty file.
·  Text file locked by other process.
·  Other valid
1 mark for 1 bullet. / 1
c / When a pupil uses the program his/her answers are stored in a 1-D array called pupil_answers.
(see paper)
Using pseudocode or a language with which you are familiar, write an algorithm for a subroutine that will:
·  Initialise the value for the variable mark
·  calculate the mark from the answers given
·  display the mark on screen.
Your algorithm should make use of the variable from (a)(ii). / 1. SET mark TO 0
2. FOR counter = 1 TO 30
3. IF question[counter].answer =
pupil_answers[counter] THEN
4. SET mark TO mark + 1
5. END IF
6. END FOR
7. SEND mark TO DISPLAY
1 mark for initialisation of mark AND display of mark (lines 1 and 7)
1 mark for FOR loop with END FOR (or similar) – Accept indention to indicate structure (lines 2 and 6)
1 mark for IF statement with correct condition and END IF - Accept indention to indicate structure (lines 3 and 5)
1 mark for incrementing mark (line 4) / 4
13 / A function is being developed to calculate information about visits to Edinburgh Castle on particular days depending on the weather.
a / The function will make use of formal and actual parameters. Explain each of these terms. / Formal parameters are the identifiers used to stand for a value that will be passed when a subprogram/method is called (such as myparameter).
(1 mark)
Actual parameters are the actual values passed to a subprogram/method at runtime (such 12).
(1 mark) / 2
b / Explain how a method is different from a function. / ·  A method is a subroutine within an object in OOP. It is defines an object’s behaviour (at run time).
·  A function is not part of an object and functions independently in a programme.
Any one bullet for 1 mark / 2
c / Visitor statistics are recorded for the previous 28 days. For each day, the statistics include the number of visitors on that day and the number of hours of sunshine.
Some of the data is shown below: (see paper)
The number of visitors for each day is held in an array called visitors and the number of hours of sunshine in sunhours. Using pseudocode or a language with which you are familiar, write an algorithm to count the number of days where the visitor count was greater than 5000 and there were 6 or more hours of sunshine and write this number of days to a text file called sunnydays. / 1. SET sunnyvar TO 0
2. FOR counter = 1 TO 28
3. IF visitors[counter] > 5000
hours_of_sunshine[counter] >= 6 THEN
4. SET sunnyvar TO sunnyvar + 1
5. END IF
6. END FOR
7. OPEN sunnydays
8. SEND sunnyvar TO sunnydays
9. CLOSE sunnydays
Answer can be given in any language or form of pseudocode.
1 mark for each of any five of the following:
·  initialise and increment sunnyvar