Computer Science Paper 2 MS by Aqib Khan
Computer Science Paper 2 MS by Aqib Khan
Answer
MP1 Level "Very Low" // the level is assigned value “very low”
Explanation points:
MP2 because CASE clauses are checked in sequence // because of the order
of the clauses
MP3 a value < 30 satisfies the first clause // Clause '< 20' will never be tested
1(c) MP1 all of the possible values are addressed via all / four / three / the other 1
clauses // there are no other possible values to map to OTHERWISE
• ThisValue: INTEGER
• Check: REAL
• Level: STRING
NumRecs ← 0
NumCopied ← 0
Mark as follows:
Note:
MP6: Both counts must have been declared and initialised
CASE OF ThisRange
1: ThisChar CHR(INT(RAND(26) + 65)) // 65 to 90:
'A' to 'Z'
ThisChar LCASE(ThisChar) // 'a' to 'z'
2: ThisChar CHR(INT(RAND(26) + 65)) // 65 to 90:
A to Z
3: ThisChar NUM_TO_STR(INT(RAND(10)) // '0' to '9'
ENDCASE
RETURN ThisChar
ENDFUNCTION
Mark as follows:
Password ""
Index 1
RETURN Password
ENDFUNCTION
Mark as follows:
4(c) One mark for the name, one for the description 3
Name:
Stub testing
Description:
A simple module is written to replace each of the modules.
The simple module will return an expected value // will output a message
to show they have been called
One mark for each password example that breaks one of the rules due to:
Length too long // length too short
Invalid character
Incorrect grouping (including number of hyphens)
Duplicated characters
1 Cat
2 Fish
5(b)(i) One mark for data values plus one mark for pointers 3
0 Frog
1 Cat
3 Elk
4 Wasp
5 Bee
1 (Cat)
2 (Fish)
3 (Elk)
5 Bee
6 Mouse
7 Dolphin
Mark as follows:
• One mark for START and END
• One mark per area outlined
"BU" 2
2 'U' ""
1
"B" 2
"B" 3
1 'B' ""
1
""
6(b)(ii) TRUE 1
6(b)(iii) One mark for explanation of problem, one mark for test strings 2
Problem:
• The inner FOR loop removes ALL characters from String2 that match the current character from String1 and not just
one instance
Test Strings:
6(b)(iv) The inner FOR loop should only remove one instance of the character from String2 1
• Single stepping
• Breakpoints
• Variable and expressions report window
• Syntax error highlighting