Unit 1, 2016 MS
Unit 1, 2016 MS
Computing
COMP1 – Problem Solving, Programming, Data Representation and
Practical Exercise
Mark scheme
2510
June 2016
It must be stressed that a mark scheme is a working document, in many cases further developed and
expanded on the basis of students’ reactions to a particular paper. Assumptions about future mark
schemes on the basis of one year’s document should be avoided; whilst the guiding principles of
assessment remain constant, details will change, depending on the content of a particular
examination paper.
1 02 5.625 // 2
5 5/8 //
45/8
Mark as follows:
3 bits before binary point correct (5);
5 bits after binary point correct (0.625 or 5/8);
Alternative:
45/8;;
MAX 1
1 04 B;4; 2
1 05 -;76; 2
1 06 4; 1
I. any quotes
Max 2
1 08 4; 1
3 of NUMPAGES \* Arabic
\* Mî`–
óN
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
2 10 24 // 16; 1
2 11 512;;; // 3
16*16;*16;÷8; //
4096;; ÷8;
MAX 2
3 13 2
Original State Input New State
S30 10 S40
S30 20 S50
S30 50 S0
S30 R S0
Mark as follows:
Any 2 rows correct;
All 3 rows correct;
3 14 5; 1
4 15 12 (bits); 1
4 16 1600 // 1
800 * 2;
4 17 48000;;; // 3
12*1600;*20;/8;
4 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Note: Only one mark for stating that either of / both of analogue and
digital signals are electrical signals
5 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
8) WHILE loop, has correct 2nd condition and correct logic, WHILE is
inside the selection structure; A. alternative correct logic for condition
10) 2nd WHILE loop, with syntax allowed by the programming language
and correct condition for the termination of the loop; R. If not inside 1st
iterative structure
11) One correct assignment statement for F or X - inside the 2nd WHILE
loop;
12) 2nd correct assignment statement for F or X - inside the 2nd WHILE
loop; R. If order of assignment statements incorrect
6 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
5 20 ****SCREEN CAPTURE**** 1
Must match code from 19, including messages on screen capture
matching those in code. Code for 19 must be sensible.
Mark as follows:
Value of 0.1 entered by the user followed by output message Not a
number greater than or equal to 1;
5 21 ****SCREEN CAPTURE**** 1
Must match code from 19, including messages on screen capture
matching those in code. Code for 19 must be sensible.
Mark as follows:
Value of 4.1 entered by the user followed by output of 2.050025;
A. output of any number between 2 and 2.1
6 24 HumanPlayersTurn // 1
MoveIsValid //
FlipStillPossible //
FlipFound //
OpponentPieceFound;
A. Piece;
R. if any additional code
R. if spelt incorrectly
I. case
6 25 DisplayGameBoard // 1
SetUpGameBoard //
CheckIfMoveIsValid //
GameOver //
PlayGame;
7 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
6 26 Score // 1
RowCount //
ColumnCount;
6 27 Count // 1
Row //
Column //
ColumnCount //
RowCount;
6 28 Row // Column; 1
6 29 Choice // 1
BoardSize //
Move;
A. Coordinates
A. PlayerName
R. if any additional code
R. if spelt incorrectly
I. case
6 30 ChangeBoardSize // 1
GetHumanPlayerMove //
GetComputerPlayerMove //
GetPlayersName //
PrintLine //
DisplayGameBoard //
DisplayMenu //
GetMenuChoice;
8 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
6 31 VB.Net 1
Row = Move Mod 10 //
MoveIsValid = False //
MoveIsValid = True //
Column = Move \ 10;
Pascal
Row := Move Mod 10 //
Column := Move Div 10 //
MoveIsValid := False //
MoveIsValid := True //
CheckIfMoveIsValid := MoveIsValid;
I. semicolons
VB6
Row = Move Mod 10 //
MoveIsValid = False //
MoveIsValid = True //
Column = Move \ 10 //
CheckIfMoveIsValid = MoveIsValid;
Java
row = move % 10 //
column = move / 10 //
moveIsValid = false //
moveIsValid = true;
I. semicolons
C#
Row = Move % 10 //
Column = Move / 10 //
MoveIsValid = false //
MoveIsValid = true;
I. semicolons
Python
Row = Move % 10 //
Column = Move // 10 //
MoveIsValid = False //
MoveIsValid = True;
9 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
The subroutine calls have been placed before the variable Row has been
given a value // The subroutine calls have been placed before the
variable Column has been given a value // The subroutine calls have
been placed before the variables have been given values // The
subroutine calls have been placed after the if statement;
//
When the user tries to place a piece in 1010 then the program will try to
insert a piece in column 101 row 0;;
NE row / column would be incorrect
Note for examiners
To get 2 marks the answer must include the inputs that would be used by
the program to produce incorrect outputs for row and column and the
incorrect values that would be assigned to both row and column from
these inputs.
7 35 ****SCREEN CAPTURE**** 2
Must match code from 34. Code for 34 must be sensible.
10 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
3) Selection structure with all four correct conditions and correct logic;
4) Check for square containing a space is only done within their attempt
at 2 and/or 3 i.e. when their conditions have been met;
11 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
8 38 ****SCREEN CAPTURE**** 2
Must match code from 36 and 37. Code for 36 and 37 must be sensible.
R. both marks if when coordinates entered are out of bounds the program
code from 37 would execute the check for an invalid square being empty.
4) Correct code will be executed if the user chooses the four centre
square option;
5) Attempt at code for the four corner square option is in the correct part
of the selection structure and code will work correctly for at least one size
of board;
6) Code for four corner square option works correctly for two corners for
all board sizes;
7) Code for four corner square option works correctly for all four corners
for all board sizes;
12 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
9 40 ****SCREEN CAPTURE**** 1
Must match code from 39, including prompts on screen capture matching
those in code. Code for 39 must be sensible.
User input for four centre square option followed by board display shown
below;
H C
C H
9 41 ****SCREEN CAPTURE**** 1
Must match code from 39, including prompts on screen capture matching
those in code. Code for 39 must be sensible.
User input for four corner square option followed by board display shown
below;
H C
C H
9 42 ****SCREEN CAPTURE**** 1
Must match code from 39, including prompts on screen capture matching
those in code. Code for 39 must be sensible.
User input for four corner square option followed by board display shown
below;
H C
C H
10 43 1) Correctly named subroutine GetFlipSquares created; I. Case and 10
minor typos
13 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
2) Two parameters of the correct data type in the routine interface for
new subroutine;
14 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
10 45 ****SCREEN CAPTURE**** 1
Must match code from 43 and 44, including prompts on screen capture
matching those in code. Code for 43 and 44 must be sensible.
15 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Pascal
16 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
8 36 ... 1
Else Move := GetComputerPlayerMove(BoardSize);
MoveIsValid := CheckIfMoveIsValid(Board, Move,
BoardSize);
Until MoveIsValid;
...
Alternative answer
17 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
18 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
19 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
20 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
VB.Net
8 36 ... 1
End If
MoveIsValid = CheckIfMoveIsValid(Board, Move, BoardSize)
Loop Until MoveIsValid
...
21 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
22 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
23 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
24 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
25 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
VB6
8 36 ... 1
End If
MoveIsValid = CheckIfMoveIsValid(Board, Move, BoardSize)
Loop Until MoveIsValid
...
26 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
27 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
28 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
29 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
10 44 ... 2
Do
If HumanPlayersTurn Then
Call GetFlipSquares(Board, BoardSize)
Move = GetHumanPlayerMove(PlayerName)
Else
Move = GetComputerPlayerMove(BoardSize)
End If
MoveIsValid = CheckIfMoveIsValid(Board, Move, BoardSize)
Loop Until MoveIsValid
...
30 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Java
31 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
System.out.println(x);
}
else {
System.out.println("Not a number greater than or equal
to 1");
}
}
32 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
7 34 String getPlayersName() { 3
String playerName;
console.print("What is your name? ");
playerName = console.readLine();
if (playerName.equals("")){
console.println("That is not a valid name, using
default name instead");
playerName = "Human player";
}
return playerName;
}
Alternative answer :
String getPlayersName() {
String playerName;
console.print("What is your name? ");
playerName = console.readLine();
if (playerName.isEmpty()) {
console.println("That is not a valid name, using
default name instead");
playerName = "Human player";
}
return playerName;
}
Alternative answer :
String getPlayersName() {
String playerName;
console.print("What is your name? ");
playerName = console.readLine();
if (playerName.length() == 0) {
console.println("That is not a valid name, using
default name instead");
playerName = "Human player";
}
return playerName;
}
8 36 . . . 1
if (humanPlayersTurn) {
move = getHumanPlayerMove(playerName);
} else {
move = getComputerPlayerMove(boardSize);
}
moveIsValid = checkIfMoveIsValid(board, move, boardSize);
} while (!moveIsValid);
. . .
33 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer :
34 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
35 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer :
36 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
10 44 . . . 2
do {
if (humanPlayersTurn) {
getFlipSquares(board, boardSize);
move = getHumanPlayerMove(playerName);
} else {
move = getComputerPlayerMove(boardSize);
}
moveIsValid = checkIfMoveIsValid(board, move, boardSize);
} while (!moveIsValid);
. . .
37 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
C#
8 36 ... 1
Move = GetComputerPlayerMove(BoardSize);
}
MoveIsValid = CheckIfMoveIsValid(Board, Move, BoardSize);
}
if (!HumanPlayersTurn)
...
38 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
39 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
40 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
41 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
42 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
10 44 ... 2
do
{
if (HumanPlayersTurn)
{
GetFlipSquares(Board, BoardSize);
Move = GetHumanPlayerMove(PlayerName);
}
else
{
Move = GetComputerPlayerMove(BoardSize);
}
MoveIsValid = CheckIfMoveIsValid(Board, Move);
} while (!MoveIsValid);
...
43 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Python 2
7 34 def GetPlayersName(): 3
PlayerName = raw_input("What is your name? ")
if PlayerName == "":
print "That is not a valid name, using default name
instead"
PlayerName = "Human player"
return PlayerName
Alternative answer
def GetPlayersName():
PlayerName = raw_input("What is your name? ")
if len(PlayerName) == 0:
print "That is not a valid name, using default name
instead"
PlayerName = "Human player"
return PlayerName
8 36 ... 1
else:
Move = GetComputerPlayerMove(BoardSize)
MoveIsValid = CheckIfMoveIsValid(Board, Move, BoardSize)
...
44 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
Alternative answer
45 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
46 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
else:
for Row in range(1, BoardSize + 1):
for Column in range(1, BoardSize + 1):
Board[Row][Column] = " "
Board[1][1] = "H"
Board[BoardSize][BoardSize] = "H"
Board[1][BoardSize] = "C"
Board[BoardSize][1] = "C"
10 44 . . . 2
while not MoveIsValid:
if HumanPlayersTurn:
GetFlipSquares(Board, BoardSize)
Move = GetHumanPlayerMove(PlayerName)
else:
. . .
47 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Python 3
7 34 def GetPlayersName(): 3
PlayerName = input("What is your name? ")
if PlayerName == "":
print("That is not a valid name, using default name
instead")
PlayerName = "Human player"
return PlayerName
Alternative answer
def GetPlayersName():
PlayerName = raw_input("What is your name? ")
if len(PlayerName) == 0:
print("That is not a valid name, using default name
instead")
PlayerName = "Human player"
return PlayerName
8 36 ... 1
else:
Move = GetComputerPlayerMove(BoardSize)
MoveIsValid = CheckIfMoveIsValid(Board, Move, BoardSize)
...
48 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
Alternative answer
49 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
Alternative answer
50 of 51
MARK SCHEME – A-LEVEL COMPUTING – COMP1 –JUNE 2016
else:
for Row in range(1, BoardSize + 1):
for Column in range(1, BoardSize + 1):
Board[Row][Column] = " "
Board[1][1] = "H"
Board[BoardSize][BoardSize] = "H"
Board[1][BoardSize] = "C"
Board[BoardSize][1] = "C"
10 44 ... 2
while not MoveIsValid:
if HumanPlayersTurn:
GetFlipSquares(Board, BoardSize)
Move = GetHumanPlayerMove(PlayerName)
else:
...
>'
51 of 51