0% found this document useful (0 votes)
5 views13 pages

Unit 2 BTest

The document contains mark schemes for programming assessments, detailing how to evaluate student responses based on various criteria such as syntax errors, logic errors, and the application of programming concepts across different languages like C#, Python, and VB.NET. It includes examples of correct and incorrect code snippets, along with specific marking guidelines for each part of the assessment. Additionally, examiner reports highlight common student misunderstandings regarding syntax versus logic errors and data structures.

Uploaded by

Eddie Cheung
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views13 pages

Unit 2 BTest

The document contains mark schemes for programming assessments, detailing how to evaluate student responses based on various criteria such as syntax errors, logic errors, and the application of programming concepts across different languages like C#, Python, and VB.NET. It includes examples of correct and incorrect code snippets, along with specific marking guidelines for each part of the assessment. Additionally, examiner reports highlight common student misunderstandings regarding syntax versus logic errors and data structures.

Uploaded by

Eddie Cheung
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Blundell's School Page 1 of 13

Mark schemes
(a) 2 marks for AO1 (recall)
1.
B A syntax error is a mistake in the grammar of the code;

D A syntax error will stop a program from running;

R. If more than two lozenges shaded


2

(b) Mark is for AO2 (apply)


Mark is for AO3 (refine)

C#
Line number: 7;

Corrected line of code: [Link](numbers[number]);

Python
Line number: 7;

Corrected line of code: print(numbers[number])

[Link]
Line number: 7;

Corrected line of code: [Link](numbers(number))

A. WriteLine changed to Write as long as all other required changes have been
made
2

(c) Mark is for AO2 (apply)

Array // List (of integers);


1
[5]

(a) Mark is for AO2 (apply)


2.
11;
1

(b) Mark is for AO2 (apply)

17;
1
[2]

Blundell's School Page 2 of 13


(a) 3 marks for AO2 (apply)
3.
Maximum 2 marks if Output shows numbers or text only with no
other errors OR fully correct but contains additional characters.

Maximum 1 mark if Output shows numbers or text only or is


inconsistent AND there is at least one error, even if additional
characters present.

I. quotation marks in the Output column


3

(b) Mark is for AO2 (apply)

Maximum of 1 mark from:

• Add validation; A. by example e.g. check width/length are positive numbers //


check height is –1 or a positive number;

• Change data types used in the question to float / single / double / decimal / real
for inputs;
1
[4]

2 marks for AO3 (test)


4.
Test type Test data Expected result

Normal data 5 Valid choice message displayed

Any value other


Invalid data than the numbers Invalid choice (message displayed)
1 to 10 inclusive

if 1 or 10 given as test data Valid


Any one of 0, 1, choice (message displayed)
Boundary data
10 or 11 if 0 or 11 given as test data Invalid
choice (message displayed)

1 mark for each completely correct row to a maximum of 2 marks.


[2]

Blundell's School Page 3 of 13


6 marks for AO2 (apply)
5.
1 mark for the i column correct;

1 mark for the first value in the daysTotal column correct;


I. preceding zeroes

1 mark for the rest of daysTotal column correct;

1 mark for the second value of weeks[0] column correct;

1 mark for the rest of weeks columns correct;

1 mark for the correct total of weeks[0], weeks[1] and weeks[2] in the final column and
no other value;
I. preceding zeroes
A. follow through value as long as the total is correct for the three final values the student
has written in the weeks columns.

Maximum of 5 marks if any errors.

I. Different rows used so long as the order within columns is clear


I. Duplicate values on consecutive rows within a column
[6]

Blundell's School Page 4 of 13


(a) 2 marks for AO3 (design), 2 marks for AO3 (program)
6.
Program Design
Note that AO3 (design) marks are for selecting appropriate
techniques to use to solve the problem, so should be credited
whether the syntax of programming language statements is correct
or not and regardless of whether the solution works.

Mark A for the idea of inputting a number within the


iteration/validation structure;
Mark B for the use of indefinite iteration;

Program Logic
Mark C for using a Boolean condition that checks the lower bound
of position;
Mark D for using a Boolean condition that checks BOTH the lower
and upper bounds of position correctly;
Marks C and D could be one expression eg 0 < position <=
100;

I. Case
I. Missing prompts

Maximum 3 marks if any errors in code.

C# Example 1 (fully correct)


All design marks are achieved (Marks A and B)
while (position < 1 || position > 100) { (C,D)
[Link]("Enter card position: ");
position = Convert.ToInt32([Link]());
}

C# Example 2 (fully correct)


All design marks are achieved (Marks A and B)
while (position <= 0 || position >= 101) { (C,D)
[Link]("Enter card position: ");
position = Convert.ToInt32([Link]());
}

C# Example 3 (partially correct – 3 marks)


1 design mark achieved (Mark A)
if (position < 1 || position > 100) { (C,D)
[Link]("Enter card position: ");
position = Convert.ToInt32([Link]());
}

Blundell's School Page 5 of 13


C# Example 4 (partially correct – 3 marks)
All design marks are achieved (Marks A and B)
while (position < 1 || position >= 100) { (Mark C)
[Link]("Enter card position: ");
position = Convert.ToInt32([Link]());
}
4

I. Indentation in C#
I. WriteLine instead of Write

Python Example 1 (fully correct)


All design marks are achieved (Marks A and B)
while position < or position > 100: (C, D)
position = int(input("Enter card position: "))

Python Example 2 (fully correct)


All design marks are achieved (Marks A and B)
while position < = 0 or position >= 101: (C, D)
position = int(input("Enter card position: "))

Python Example 3 (partially correct – 3 marks)


1 design mark achieved (Mark A)
if position < 1 or position > 100: (C, D)
position = int(input("Enter card position: "))

Python Example 4 (partially correct – 3 marks)


All design marks are achieved (Marks A and B)
while position < 1 or position > = 100: (C)
position = int(input("Enter card position: "))

[Link] Example 1 (fully correct)


All design marks are achieved (Marks A and B)
while position < 1 or position > 100 (C, D)
[Link]("Enter card position: ")
position = [Link]()
End While

[Link] Example 2 (fully correct)


All design marks are achieved (Marks A and B)
while position <= 0 or position >= 101 (C, D)
[Link]("Enter card position: ")
position = [Link]()
End While

[Link] Example 3 (partially correct – 3 marks)


1 design mark achieved (Marks A)
If position < 1 or position > 100 Then (C, D)
[Link]("Enter card position: ")
position = [Link]()
End If
Blundell's School Page 6 of 13
[Link] Example 4 (partially correct – 3 marks)
All design marks are achieved (Marks A and B)
Do While position < 1 or position >= 100 (Mark C)
[Link]("Enter card position: ")
position = Convert.ToInt32([Link]())
Loop

I. Indentation in [Link]
I. WriteLine instead of Write

(b) 2 marks for AO3 (design), 4 marks for AO3 (program)


Any solution that does not map to the mark scheme refer to lead
examiner

Program Design
Note that AO3 (design) marks are for selecting appropriate
techniques to use to solve the problem, so should be credited
whether the syntax of programming language statements is correct
or not and regardless of whether the solution works.

Mark A for the idea of using an iteration structure which attempts to


access each element in the cards array; // attempts to repeat 100
times;
Mark B for the idea of using a selection structure which attempts to
compare two cards;

Program Logic
Mark C for using a loop or similar to correctly iterate through the
cards array using valid indices that do not go out of range;
Mark D for using a correct Boolean condition to access the values
in the cards array;
Mark E for correctly checking if there are five values in the cards
array that are in sequence;
Mark F for setting gameWon to True in the correct place;

I. Case

Maximum 5 marks if any errors in code.

Blundell's School Page 7 of 13


C# Example 1 (fully correct)
All design marks are achieved (Marks A and B)
int count = 1; (Part of E)
for (int i = 0; i < 99; i++) { (C)
if (cards[i] + 1 == cards[i + 1]) { (D, Part of E)
count = count + 1; (Part of E)
if (count == 5) { (Part F)
gameWon = true; (Part F)
}
}
else {
count = 1; (Part of E)
}
}

C# Example 2 (fully correct)


All design marks are achieved (Marks A and B)
int count = 1; (Part of E)
int i = 0; (Part of C)
while (i < 99) { (Part of C)
if (cards[i] + 1 == cards[i+1]) { (D, part of E)
count = count + 1 (Part of E)
if (count == 5) { (Part F)
gameWon = True (Part F)
}
}
else {
count = 1; (Part of E)
}
i = i + 1 (Part of C)
}

I. Indentation in C#

Python Example 1 (fully correct)


All design marks are achieved (Marks A and B)
count = 1 (Part of E)
for i in range(99): (C)
if cards[i] + 1 == cards[i + 1]: (D, Part of E)
count = count + 1 (Part of E)
if count == 5: (Part F)
gameWon = True (Part F)
else:
count = 1 (Part of E)

Blundell's School Page 8 of 13


Python Example 2 (fully correct)
All design marks are achieved (Marks A and B)
count = 0 (Part of E)
i = 0 (Part of C)
while i < len(cards) - 1: (Part of C)
if cards[i] + 1 == cards[i + 1]: (D, Part of E)
count = count + 1 (Part of E)
if count == 4: (Part F)
gameWon = True (Part F)
else:
count = 0 (Part of E)
i = i + 1 (Part of C)

Python Example 3 (fully correct)


All design marks are achieved (Marks A and B)
gameWon = False (Part F)
for i in range(96): (C)
count = 1 (Part of E)
for j in range(1, 5): (Part of D)
if cards[i + j] - 1 == cards[i + j - 1]: (Part of D)
count += 1 (Part of E)
(Part of E)
if count == 5: (Part F)
gameWon = True (Part F)

[Link] Example 1 (fully correct)


All design marks are achieved (Marks A and B)
Dim count As Integer = 1 (Part of E)
For i = 0 To 98 (C)
If cards(i) + 1 = cards(i+1) Then (D, Part of E)
count = count + 1 (Part of E)
If count = 5 Then (Part F)
gameWon = True (Part F)
End If
Else
count = 1 (Part of E)
End If
Next

Blundell's School Page 9 of 13


[Link] Example 2 (fully correct)
All design marks are achieved (Marks A and B)
Dim count As Integer = 0 (Part of E)
Dim i As Integer = 0 (Part of C)
While i < 99 (Part of C)
If cards(i) + 1 = cards(i+1) Then (D, Part of E)
count = count + 1 (Part of E)
If count = 4 Then (Part of F)
gameWon = True (Part F)
End If
Else
count = 0 (Part of E)
End If
i = i + 1 (Part of C)
End While

I. Indentation in [Link]
6
[10]

2 marks for AO3 (design), 4 marks for AO3 (program)


7.
Program Design
Note that AO3 (design) marks are for selecting appropriate techniques to use to solve the
problem, so should be credited whether the syntax of programming language statements is
correct or not and regardless of whether the solution works.

Mark A for the use of a definite iteration structure, or similar, that exists within their
language to carry out the requirements of the task;

Mark B for the use of a selection structure to check visitor numbers;

Program Logic
Mark C for correctly defining the subroutine and parameter;

Mark D for accepting user input multiple times as per the parameter or equivalent,
representing the number of days; R. if iteration syntax or boundaries are not fully correct

Mark E for adding one to a counter variable inside a selection structure under the correct
conditions, which has been appropriately initialised (to 0);

Mark F for returning the counter value calculated within the subroutine;

Maximum 5 marks if any errors in code.

I. Case
I. Messages or no messages with input statements
I. Gaps/spaces throughout the code, except where to do so would explicitly alter the logic
of the code in a way that makes it incorrect

Blundell's School Page 10 of 13


Python Example 1 (fully correct)
All design marks are achieved (Marks A and B)

def countDays(days): (C)


count = 0 (Part E)
for i in range(days): (Part D)
visitors = int(input()) (Part D)
if visitors > 200: (Part E)
count = count + 1 (Part E)
return count (F)

Python Example 2 (fully correct)


All design marks are achieved (Marks A and B)

def countDays(days): (C)


count = 0 (Part E)
i = 0 (Part D)
while (i < days): (Part D)
if int(input()) > 200: (Part D)
(Part E)
count += 1 (Part E)
i += 1 (Part D)
return count (F)
[6]

Blundell's School Page 11 of 13


Examiner reports
The responses to this question showed that students do not fully understand the difference
1. between syntax and logic errors, as less than 25% of students identified and were able to fix the
logic error on line 7, with most students correcting the syntax error on line 6 instead.

Nearly 70% of students were able to identify the data structure in part (c) but integer alone was a
very common wrong answer.

This question asked for students to work through three subroutines testing understanding of
2. parameters and return values. Students were asked to identify the output based on inputs.
However, as in past series, this type of question is still causing students some issues. Fewer
than a third of students could correctly trace through two subroutines and that number dropped to
fewer than a quarter when the trace involved three subroutines, with students tending to stop at
the end of the first part and returning a string including the function call.

This question was the first trace table and the first time that a question has involved the use of
3. format strings (f"" in Python or $"" in C# and [Link]). Teachers are advised to make use of the
programming resources that AQA have made available as a lot of students either didn’t include
the string part of the output or included { } with their outputs. The mark scheme made some
allowances for students that traced the algorithm correctly but made errors in the output.
Students should also be reminded that when a string is output the " " are not necessary in trace
tables.

Some students were unclear as to the meaning of the term robust with common incorrect
answers to part (b) referring to adding comments to code to make it clear or renaming the
variables to something more meaningful. Less than 30% of students were able to identify that
validation in some form needed to be added to the program.

This question was the second trace table and tested the student’s ability to work with lists/arrays.
5. Over a third of the students gained all the available marks with over 80% getting at least 1. The
most common mistake was to put the output for the week’s total inside the loop.

Part (a) was a straightforward programming question and over 30% of the students gained all the
6. available marks. One area that caused mistakes was the misunderstanding of the word inclusive,
as students calculated the boundaries incorrectly.

A lot of students used a REPEAT UNTIL structure, when their language does not have one. Also,
the use of composite conditions such as 0 < position <= 100 should be discouraged, as
some students became confused by the logic, and students were still using them when their
chosen language did not support them.

Part (b) used a list/array to hold the cards and once again showed that students struggle to use
indexing correctly. Whilst less than 10% picked up all the available marks, over a quarter
managed to get at least four marks, which shows that they understood what the question was
asking. A common issue for students was that they did not realise that to count five pairs, they
only needed four comparisons. Similar mistakes were made while setting the conditions for the
loop, looping either one time too many or one time too few. While it is perfectly possible to solve
this question using only while loops (with no ‘IF’ selection), it’s also a lot more difficult and only a
few students who went down this route achieved full marks.

Blundell's School Page 12 of 13


For this question, as with previous coding questions, a large number of students did not attempt
7. the question; however 40% of the students gained four of the available six marks. Some students
did not create the subroutine correctly – this was an issue in all three languages but especially
where a function is specifically required. This question tested the use of a definite loop, but a lot
of students did not gain the mark due to incorrect conditions being used in the loop. A significant
number of students also printed the value rather than returning as the question asks.

Blundell's School Page 13 of 13

You might also like