AQA GCSE Computer Science Paper 1 (1A), June 2025: Question 10

8 marks · Medium difficulty · Programming

Instantiate and access a record data structure in pseudo-code, and write a C# program to find and output the minimum value in an array.

Practise this question

Question

Question 10 describes a record structure 'Runner' with fields: event (String), runnerNumber (Integer), and time (Real). Part 10.1 asks to complete a line of pseudo-code to create record 'race3' from a table with event '200 m', runnerNumber 10, and time 32.59. Part 10.2 asks to complete pseudo-code to output the time of 'race2'. Part 10.3 requires writing a C# program to find and output the fastest time (smallest real number) from an array called 'times' without using built-in min or sort routines, provided with a lined answer grid.
Question text

10 A programmer is writing an algorithm, using pseudo-code, to store the results of

running events.

The programmer uses a record data structure.

Each record stores:

• the name of the running event

• the runner’s number

• the time in seconds for that runner in that event.

Figure 10 shows the record structure.

Figure 10

RECORD Runner

event : String

runnerNumber : Integer

time : Real

ENDRECORD

10.1 Figure 11 shows pseudo-code used to create two records using the structure in

Figure 10.

Figure 11

race1 Runner('400 m', 23, 51.35)

race2 Runner('400 m', 14, 63.26)

Complete the line of pseudo-code to create a new record that contains the following

data:

event runnerNumber time

200 m 10 32.59

[1 mark]

race3

10.2 Complete the line of pseudo-code needed to output the time of race2

[1 mark]

OUTPUT race2 27

10.3 The programmer wants to find the fastest time for a particular running event.

The times for all the runners in the event are stored in an array of real numbers

called times

Write a C# program to find the fastest time.

*26*Your program must:

• find the smallest value in the array (ie the fastest time)

• output the smallest value

• work with any size of array.

For example, if times contains 28.5, 26.3 and 30.0, the output should be 26.3

The program you write must not use any built-in routines to find the smallest

value in an array or to sort the array into an order.

You do not need to write code to create the array times

You should use meaningful variable name(s) and C# syntax in your answer.

The answer grid below contains vertical lines to help you indent your code.

[6 marks]

Mark scheme

Show the mark scheme Mark scheme for Question 10. Part 1 awards 1 mark for 'Runner('200 m', 10, 32.59)'. Part 2 awards 1 mark for '.time'. Part 3 awards up to 6 marks: 1 design mark for attempting to calculate array length, and 5 program logic marks for initialising minimum tracking variable, looping correctly through the array, comparing array elements to current minimum, updating minimum, and outputting the final result once. Example solutions are provided in VB.NET.

Total

Question Part Marking guidance

marks

10 1 Mark is for AO2 (apply) 1

Runner('200 m', 10, 32.59);

I. Case

R. if quotes, commas or parentheses missing

Total

Question Part Marking guidance

marks

10 2 Mark is for AO2 (apply) 1

.time;

I. Case

R. if period is missingMARKSCHEME – COMPUTER SCIENCE – – JUNE 2025

Total

Question Part Marking guidance

marks

10 3 1 mark for AO3 (design), 5 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 attempting to calculate the length of the array times;

Program Logic

Mark B for initialising a variable to an appropriate numeric value to store the

fastest time or the index to the fastest time;

Mark C for using a loop to correctly iterate through an array of any length;

Mark D for correctly checking values (on at least 2 occasions) in the times

array are smaller than the current fastest time (even if the indexing is

incorrect);

Mark E correctly store the current fastest time/position of the fastest time for

each iteration (indexing must be correct);

Mark F for outputting the fastest time from a variable once, in an

appropriate place;

Note to Examiners

If used built in routines to find the smallest value in an array or to sort the

array then do not award marks D, E

I. Case

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.

Maximum 5 marks if any errors in code.

Note to examiners

In C#/VB.NET examples, explicit variable declarations are not shown. Refer

to the specific language type issues section of the appropriate Marking

Guidance document. Any correct variable declarations in student answers

should be accepted.MARKSCHEME – COMPUTER SCIENCE – – JUNE 2025

VB.NET Example 1 (fully correct)

All design marks are achieved (Mark A)

length = times.Length Part of C

best = times(0) B, Part of D

For i = 1 to length - 1 Part of C

If times(i) < best Then Part of D

best = times(i) E

End If

Next

Console.WriteLine(best) F

A. Write in place of WriteLine;

I. missing Console.

VB.NET Example 2 (fully correct)

All design marks are achieved (Mark A)

best = times(0) B, Part of D

For Each time In times C

If time < best Then Part of D

best = time E

End If

Next

Console.WriteLine(best) F

A. Write in place of WriteLine;

I. missing Console.

How to answer it

Record Structures & Finding the Minimum Value in C#

📌 What this question tests

This exam question assesses foundational programming constructs and algorithmic thinking:

  • Instantiating records (AO2): Declaring and assigning values to a composite user-defined data type (Record).
  • Accessing record attributes (AO2): Using dot notation to extract a specific field from a record instance.
  • Linear search / Min algorithm (AO3): Implementing an iterative search in C# without using built-in helper functions ( .Min() or Array.Sort() ) to find the lowest numerical value in an array.
Question 10.1 • 1 Mark

Creating a New Record Instance

Completing the pseudo-code assignment statement

✅ Correct Answer

Runner('200 m', 10, 32.59)

Full line completed:
race3 ← Runner('200 m', 10, 32.59)

💡 Key Knowledge

A record is a composite data structure that groups related fields of differing data types under a single name. When instantiating:

  • Parameters must match the record definition order: event (String), runnerNumber (Integer), time (Real).
  • Strings require quotation marks (single or double).

🧠 Exam Technique

Look directly at Figure 11 above the question for the exact syntax pattern:

race1 ← Runner('400 m', 23, 51.35)

Follow the same casing, parameter order, and punctuation style.

❌ Common Errors

  • Omitting quotation marks around '200 m' .
  • Swapping the order of values (e.g. putting 10 first).
  • Missing commas or opening/closing brackets.
Mark Scheme Note: 1 mark for AO2. Ignore letter casing. Reject answers with missing quotes, commas, or parentheses.
Question 10.2 • 1 Mark

Accessing Record Fields

Using dot notation to retrieve data

✅ Correct Answer

.time

Full line completed:
OUTPUT race2.time

💡 Key Knowledge: Dot Notation

To access an individual field within an instantiated record, write the variable name followed by a dot ( . ) and the field name:

recordVariable.fieldName

❌ Common Errors

  • Omitting the leading full stop ( . ), writing just time .
  • Writing array index syntax, e.g. [time] or [2] . Records use field names, not numerical indices!

🧠 Exam Technique

The prompt already gives OUTPUT race2 . You only need to provide what attaches to race2 to get the time attribute, which is .time .

Mark Scheme Note: 1 mark for AO2. Ignore case. Reject if the period ( . ) is omitted.
Question 10.3 • 6 Marks

Finding the Smallest Value in an Array (C#)

Writing an algorithm without built-in functions

✅ Model Solution 1: Standard 'for' Loop

double fastest = times[0]; for (int i = 1; i < times.Length; i++) { if (times[i] < fastest) { fastest = times[i]; } } Console.WriteLine(fastest);

✅ Model Solution 2: 'foreach' Loop

double fastest = times[0]; foreach (double t in times) { if (t < fastest) { fastest = t; } } Console.WriteLine(fastest);

📐 Step-by-Step Logic Breakdown (How Marks Are Awarded)

  1. Mark B – Initialise min variable: Set fastest to the first element times[0] (or an extremely large number). Never initialise to 0 when searching for a minimum!
  2. Mark A & C – Iterate across the array: Use times.Length (Mark A) inside a loop (Mark C) so the code works for an array of any size.
  3. Mark D – Comparison check: Compare array element with the current lowest: if (times[i] < fastest) .
  4. Mark E – Update min value: Inside the conditional branch, overwrite the variable: fastest = times[i]; .
  5. Mark F – Final Output: Print the result once, after the loop finishes: Console.WriteLine(fastest); .

❌ Common Traps & Mistakes

  • Initialising minimum to 0: Since running times are positive, fastest would remain 0 because no positive time is less than zero.
  • Hardcoding array length: Writing i < 3 violates the requirement that the code must "work with any size of array". Always use times.Length .
  • Using forbidden methods: Using times.Min() or Array.Sort() loses Marks D and E automatically.
  • Outputting inside the loop: Putting Console.WriteLine inside the loop body outputs values repeatedly instead of once.

🧠 Exam Technique for 6-Mark Code Questions

  • Array size: In C#, array length is accessed via the property .Length (capital L).
  • Output command: Standard C# console output is Console.WriteLine(...) or Console.Write(...) . The examiner will accept missing Console. , but it's best practice to write it.
  • Indentation: Use the answer grid lines to keep your blocks of code and curly braces neat.
Mark Breakdown: 1 mark AO3 (Design - Mark A for finding array length), 5 marks AO3 (Program Logic - Marks B to F). Maximum 5 marks if syntax or logic contains any errors.

Topics

3.2 Programming · 3.2.2 Programming concepts · 3.2.4 Relational operations in a programming language · 3.2.6 Data structures · 3.2.7 Input/output

Question and mark scheme from the AQA GCSE Computer Science examination, Paper 1 (1A), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.