AQA GCSE Computer Science Paper 1 (1C), June 2025: Question 4
13 marks · Medium difficulty · Programming
Answer questions on input validation, test data types, writing a validation program in VB.NET, and completing a flowchart for username generation.
Practise this questionQuestion
Question text
04 A programmer is developing a system to register users for an app. The program
needs to validate the first name of the user.
04.1 Identify the purpose of validation.
Shade one lozenge.
[1 mark]
A Checks that the user is human
B Checks that the user is who they say they are
C Checks that the input is a name
D Checks that the input is reasonable
04.2 Write a VB.NET program to check the user’s first name.
Your program should:
• get the user’s first name
• check that the first name has more than one character and fewer than 15
characters:
o if it has, output the message Name accepted
o if it has not, output the message Name not accepted
• repeat until the name entered has a specified length.
You should use meaningful variable name(s) and VB.NET syntax in your answer.
The answer grid below contains vertical lines to help you indent your code.
[6 marks]
04.3 Which of the following statements best describes boundary test data?
*08*Shade one lozenge.
[1 mark]
A Data that is not of the allowed data type
B Data that is at the limits of the allowed range
C Data that is expected by the program
D Data that will cause a syntax error
04.4 The programmer has started planning the tests that will be used to check the program
is working correctly.
The program should:
• check that the first name has more than one character and fewer than 15
characters:
o if it has, then output the message Name accepted
o if it has not, then output the message Name not accepted
The start of the test plan is shown in Figure 3.
Figure 3
Test Type of
Test data Expected result
number test data
1 Thomas Normal Name accepted
2 Boundary Name not accepted
State the number of characters that a string used for test number 2 in Figure 3 could
contain.
[1 mark]
04.5 Normal and boundary are two types of test data.
State one type of test data that has not been used in Figure 3.
[1 mark]
04.6 A programmer is designing an algorithm to generate usernames for users.
The algorithm should:
• ask the user to input their first name and their last name
• create a username:
*10*o if their first name has more than three characters, their username will consist of
the first three characters of their first name followed by their last name
o if their first name has three or fewer characters, their username will consist of
their full first name followed by their last name
• output the username.
Figure 4 contains the statements required to implement a version of this algorithm.
Figure 4
firstName USERINPUT
LEN(firstName) > 3
username firstName + lastName
OUTPUT username
username SUBSTRING(0, 2, firstName) + lastName
lastName USERINPUT
Using the labels ( to ) shown in Figure 4, complete the flowchart to implement
the algorithm.
[3 marks]
Mark scheme
Show the mark scheme
Total
Question Part Marking guidance
marks
04 1 Mark is for AO1 (recall) 1
D Checks that the input is reasonable;
R. If more than one lozenge shaded
Total
Question Part Marking guidance
marks
04 2 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 the use of an iteration structure that exists within their language,
which attempts to repeat until a first name with a valid length is entered;
Program Logic
Mark B for finding the length of at least one string correctly;
Mark C for one Boolean condition that attempts to check the first name or
length of first name entered against one of the two required conditions (even
if the length usage is incorrectly coded or missing);
A. if the only error is quotes included around numeric values;
Mark D if all required checks on the length of the first name have been
carried out and combined correctly;
R. if any quotes included around numeric values
Mark E for code that allows the re-inputting of a first name within an iteration
structure;
Mark F for a structure that would output either Name accepted or Name
not accepted correctly in all circumstances; A. if conditions are
not fully correct; A. equivalent messages;
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.
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.MARK SCHEME – – –
C# Example 1 (fully correct)
The design mark is achieved (Mark A)
name = Console.ReadLine();
while (name.Length < 2 || name.Length > 14) { BCD, Part E
Console.WriteLine("Name not accepted"); Part F
name = Console.ReadLine(); Part E
}
Console.WriteLine("Name accepted"); Part F
A. Write in place of WriteLine
I. missing Console.
Python Example 1 (fully correct)
The design mark is achieved (Mark A)
name = input()
while len(name) < 2 or len(name) > 14: BCD, Part E
print("Name not accepted") Part F
name = input() Part E
print("Name accepted") Part F
Python Example 2 (fully correct)
The design mark is achieved (Mark A)
check = False Part E
while check == False: Part E
name = input() Part E
if len(name) > 1 and len(name) < 15: BCD
print("Name accepted") Part F
check = True
else:
print("Name not accepted") Part F
Python Example 3 (fully correct)
The design mark is achieved.
Check that all pathways are covered when using nested if statements and
all required messages are included.
while True: Part E
name = input()
if len(name) > 1: BC
if len(name) < 15: D
print("Name accepted") Part F
break
else:
print("Name not accepted") Part F
else:
print("Name not accepted") Part F
VB.NET Example 3 (fully correct)
The design mark is achieved.
Check that all pathways are covered when using nested if statements and
all required messages are included.
While True Part E
name = Console.ReadLine()
If Len(name) > 1 Then BC
If Len(name) < 15 Then D
Console.WriteLine("Name accepted") Part F
Exit While
Else
Console.WriteLine("Name not accepted") Part F
End If
Else
Console.WriteLine("Name not accepted") Part F
End If
End While
A. Write in place of WriteLine;
I. missing Console.
Total
Question Part Marking guidance
marks
04 3 Mark is for AO1 (recall) 1
B Data that is at the limits of the allowed range;
R. If more than one lozenge shaded
Total
Question Part Marking guidance
marks
04 4 Mark is for AO3 (test) 1
1 // 15;
A. if both correct answers are given;
Total
Question Part Marking guidance
marks
04 5 Mark is for AO1 (recall) 1
Erroneous;
A. Invalid;
A. Description of a type of erroneous test data e.g. data of the wrong type;
I. Minor spelling mistakes
R. Typical
R. Extreme
R. Boundary
R. Normal
Total
Question Part Marking guidance
marks
04 6 3 marks for AO3 (design) 3
MP1: for L1, L6 (I. Order of L1 and L6) and L4;
MP2: for L2;
MP3: for L3 and L5;
I. any pseudocode if labels are given
A. The exact given pseudo-code statements if labels are omitted;
How to answer it
Data Validation, Robust Programming & Flowcharts
This multi-part question tests your understanding of robust program design and algorithmic logic:
- Recall of core theory: The definition/purpose of data validation and test data classifications (normal, boundary, erroneous).
- Length check implementation: Writing an iterative input-validation routine that accepts input until it meets specific length constraints (> 1 and < 15 characters).
- Boundary value analysis: Determining precise lengths that trigger failure right on the edge of validity.
- Algorithm representation: Mapping string manipulation and selection logic into an industry-standard flowchart.
Purpose of Validation
Identify the primary function of an automated validation check
✅ Correct Answer
D — Checks that the input is reasonable
💡 Key Knowledge
Validation is an automatic computer check to ensure data is sensible and reasonable before processing. It can never check whether data is actually truthful or authentic (e.g. your real name).
❌ Common Errors & Traps
- Confusing validation with verification (checking that data matches the original source or user identity).
- Assuming a validation check can know if someone is human (that is a CAPTCHA's specific role, not general validation).
Writing an Iterative Length Check Program
Program specification: Take a first name, test for > 1 and < 15 characters, output status, and repeat until valid.
✅ Example Solutions
Option A: VB.NET (Standard loop & exit)
Dim name As String = "" While True name = Console.ReadLine() If name.Length > 1 And name.Length < 15 Then Console.WriteLine("Name accepted") Exit While Else Console.WriteLine("Name not accepted") End If End WhileOption B: Python equivalent (for cross-study)
name = input() while len(name) <= 1 or len(name) >= 15: print("Name not accepted") name = input() print("Name accepted")🧠 Exam Technique & Mark Scheme Breakdown
- Mark A (Design): Using an iterative loop ( While , Do While ) to re-prompt until valid.
- Mark B (Logic): Finding length correctly ( name.Length in VB or len(name) in Python).
- Mark C (Logic): Testing at least one boundary correctly (> 1 or < 15).
- Mark D (Logic): Combining both conditions correctly with And (if checking validity) or Or (if checking for rejection).
- Mark E (Logic): Re-reading input inside/during loop iteration.
- Mark F (Logic): Outputting exact strings: "Name accepted" and "Name not accepted" .
❌ Common Code Pitfalls
- Quotes around numbers: Writing name.Length > "1" forfeits Mark D.
- Wrong relational operators: Writing >= 1 instead of strictly > 1 ("more than one character" means length must be at least 2).
- Infinite loops: Forgetting to re-prompt user input inside the loop body.
📐 Condition Breakdown
The rules specify: "more than 1 character and fewer than 15 characters":
- Valid lengths: 2 up to 14 characters inclusive ( length > 1 And length < 15 )
- Invalid lengths: 1 or fewer, OR 15 or more ( length <= 1 Or length >= 15 )
Boundary Test Data
Identify the statement that best describes boundary data
✅ Correct Answer
B — Data that is at the limits of the allowed range
💡 Key Knowledge
Boundary data sits right at the edges of accepted and rejected limits. For example, if a system accepts numbers from 1 to 10, boundary data includes 0, 1, 10, and 11.
Applying Test Types to the Validation Routine
04.4: Boundary Character Count (1 Mark)
Accepted values: 1 OR 15
Test 2 requires Boundary data that outputs "Name not accepted".
Allowed lengths are 2 to 14.
The extreme values that fail right at the boundary are precisely 1 character or 15 characters.
04.5: Unused Test Data Type (1 Mark)
Accepted answer: Erroneous (or Invalid)
Figure 3 used Normal (Test 1) and Boundary (Test 2).
The third fundamental testing category is Erroneous data — data of the incorrect data type or format that should be rejected immediately.
Rejected terms: Extreme, Typical (these are alternative names for boundary/normal, not the third missing type).
Flowchart Construction: Username Generator
Place labels L1 to L6 into the correct positions on the flowchart
Given Statements (Figure 4)
- L1 : firstName ← USERINPUT
- L2 : LEN(firstName) > 3
- L3 : username ← firstName + lastName
- L4 : OUTPUT username
- L5 : username ← SUBSTRING(0, 2, firstName) + lastName
- L6 : lastName ← USERINPUT
✅ Flowchart Label Sequence
🧠 Logic Behind the Placements
- Input Order (L1 & L6): The program must get both names before testing length. Either first name or last name can be entered first.
- Decision Box (L2): Flowchart diamonds test a Boolean condition ( LEN(firstName) > 3 ).
- Branch Logic: If Y (Yes), the name has more than 3 characters, so execute L5 (take substring). If N (No), execute L3 (use entire name). Both paths converge into L4 to display the result.
- MP1: Correct placement of L1, L6 and L4.
- MP2: Correct placement of decision L2.
- MP3: Correct placement of both processes L3 and L5.
Topics
3.1 Fundamentals of algorithms · 3.2 Programming · 3.1.1 Representing algorithms · 3.2.2 Programming concepts · 3.2.7 Input/output · 3.2.8 String handling operations in a programming language · 3.2.11 Robust and secure programming
Question and mark scheme from the AQA GCSE Computer Science examination, Paper 1 (1C), June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.