AQA A-Level Computer Science AS Paper 1, June 2025: Question 16
12 marks · Hard difficulty · Programming
Amend the subroutine FindLandingPlace in the Skeleton Program to allow the user to select an alternative beach landing site, validating that the chosen coordinates represent a beach, and provide test evidence via screen captures.
Practise this questionQuestion
Question text
16 The Skeleton Program is to be extended so that the pirate can come ashore at any
location that is a beach. The user will be asked to select the landing place.
What you need to do:
Task 1
Amend the subroutine FindLandingPlace so it asks the user whether they want
to use a different landing place to the one marked by X on the map.
If the user chooses to change the landing place, they should be asked for a row and a
column for the new landing place.
The subroutine should then check whether the given square is part of a beach.
A beach square is sand and has a square of water on the N, E, S or W side.
• If the given square is a beach square:
o the pirate’s position should be set to this square
o the pirate (P) should be placed on the map
o the map should be displayed.
• If the given square is not a beach square:
o the pirate will use the landing place given on the map (marked by X)
o a suitable message should be output.
You should assume that the user enters a row and column number that are not at the
very edge of the map, ie the row number is not 0 or 19 and the column number is not
0 or 41 for the map in the data file.
Task 2
Test that the changes you have made work by conducting the following test:
• run your amended Skeleton Program
• choose a different landing place
• enter 6 for the row
• enter 1 for the column
Task 3
Test that the changes you have made work by conducting the following test:
• run your amended Skeleton Program
• choose a different landing place
• enter 17 for the row
• enter 21 for the column
• enter W 13
• enter 1N
Evidence that you need to provide
Include the following evidence in your Electronic Answer Document.
16.1 Your PROGRAM SOURCE CODE for the entire subroutine FindLandingPlace.
[10 marks]
16.2 SCREEN CAPTURE(S) showing the requested test described in Task 2.
The SCREEN CAPTURE(S) must show the user input and the map showing where
the pirate lands.
[1 mark]
16.3 SCREEN CAPTURE(S) showing the requested test described in Task 3.
The SCREEN CAPTURE(S) must show the user input and the map showing the
pirate’s position after walking.
[1 mark]
Mark scheme
Show the mark scheme
16 1 2 marks for AO3 (design) and 8 marks for AO3 (programming) 10
Marking guidance:
Evidence of AO3 design – 2 marks:
Evidence of design to look for in response:
1. Identify the need to ask for row and column;
2. Identify the need to test for sand or water to check for a beach;
Note: AO3 (design) points 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.
Evidence of AO3 programming – 8 marks:
Evidence of programming to look for in response:
3. Ask for user input whether different landing place required;
4. Correctly assign user input to entered row and column variables;
5. Check that the entered row and column represent sand;
6. Correctly check that entered position is next to water;
7. only if on sand and next to water …
8. … Set pirate position to entered position;
9. … and put pirate on map and display map;
10. … otherwise output a suitable message;
– – –
Max 9 if any errors
16 2 Mark is for AO3 (evaluate) 1
**** SCREEN CAPTURE ****
Must match code from 16.1, including prompts on screen capture matching those in
code.
Code for 16.1 must be sensible.
X marks the spot where the pirate comes ashore
Do you want the pirate to land elsewhere? (Y/N): Y
Which row is the pirate coming ashore? 6
Which column is the pirate coming ashore? 1
012345678901234567890123456789012345678901
0 WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
1 WWWWWWW … WWWWWWWWWW
2 WWWWW … WWWWWWWW N
3 WWWW … WWWWWW NW | NE
4 WW … R … WWWW \ | /
5 W … WWW W -----|----- E
6 WP … WW / | \
7 W … *..*...* … W SW | SE
8 W … W S
9 W … * … * … H … W
14 0 W … * … W
1 W … * … * … W
2 WW … BBWW
3 WWW … BBWWW
4 WWWWW … BBBBBB...BBWWWW
5 WWWWWW … BBWWWWWBBBBWWWWW
6 WWWWWWW … BBBWWWWWWWWWWWWWWWW
7 WWWWWWWWWW … BBWWWWWWWWWWWWWWWWWW
8 WWWWWWWWWWW … X … BBWWWWWWWWWWWWWWWWWWW– – –
9 WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
16 3 Mark is for AO3 (evaluate) 1
**** SCREEN CAPTURE ****
Must match code from 16.1, including prompts on screen capture matching those in
code.
Code for 16.1 must be sensible.
X marks the spot where the pirate comes ashore
Do you want the pirate to land elsewhere? (Y/N): Y
Which row is the pirate coming ashore? 17
Which column is the pirate coming ashore? 21
That was not a good landing place, so the pirate lands at X
Pirate to walk (W) or dig (D), to finish game press Enter: W
Enter length (between 1 and 9) and direction (N, NE, E, SE, S,
SW, W, NW): 1N
012345678901234567890123456789012345678901
0 WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWW
1 WWWWWWW … WWWWWWWWWW
2 WWWWW … WWWWWWWW N 15
3 WWWW … WWWWWW NW | NE
4 WW … R … WWWW \ | /
5 W … WWW W -----|----- E
6 W … WW / | \
7 W … *..*...* … W SW | SE
8 W … W S
9 W … * … * … H … W
0 W … * … W
1 W … * … * … W
2 WW … BBWW
3 WWW … BBWWW
4 WWWWW … BBBBBB...BBWWWW
5 WWWWWW … BBWWWWWBBBBWWWWW– – –
6 WWWWWWW … BBBWWWWWWWWWWWWWWWW
7 WWWWWWWWWW … P … BBWWWWWWWWWWWWWWWWWW
8 WWWWWWWWWWW … X … BBWWWWWWWWWWWWWWWWWWW
16 1 9 WWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWWpublic static void FindLandingPlace(string[,] map, 10
MapSizeRecord mapSize, ref PirateRecord pirate)
{
bool found = false;
int row = 0;
while (!found && (row < mapSize.rows))
{
int column = 0;
while (!found && (column < mapSize.columns))
{
if (map[row, column] == "X")
{
found = true;
pirate.row = row;
pirate.column = column;
}
column++;
}
row++;
16 }
DisplayMap(map, mapSize);
Console.WriteLine("X marks the spot where the pirate comes
ashore");
Console.WriteLine();
Console.Write("Do you want the pirate to land elsewhere
(Y/N) ");
string answer = Console.ReadLine(); // MP3
if (answer == "Y")
{
Console.Write("Which row is the pirate coming ashore? ");
row = Convert.ToInt32(Console.ReadLine()); // MP1
Console.Write("Which column is the pirate coming ashore?
");
int column = Convert.ToInt32(Console.ReadLine()); // MP4
bool onSand = false;
bool nextToWater = false;
if (map[row, column] == SAND) //MP5
{
onSand = true;
}
if (map[row - 1, column] == WATER || map[row + 1, column]
== WATER) // MP2
{
nextToWater = true;
}
if (map[row, column - 1] == WATER || map[row, column + 1]
== WATER) // MP6
{
nextToWater = true;
}
if (onSand && nextToWater) // MP7
{
pirate.row = row;
pirate.column = column;– // MP8 – –
map[row, column] = PIRATES;
DisplayMap(map, mapSize); // MP9
16 1 void FindLandingPlace(String[][] Map, MapSizeRecord MapSize, PirateRecord Pirate) { 10
32 boolean Found = false;
int Row = 0;
while (!Found && Row < (MapSize.Rows)) {
int Column = 0;
while (!Found && Column < (MapSize.Columns)) {
if (Map[Row][Column].equals("X")) {
Found = true;
Pirate.Row = Row;
Pirate.Column = Column;
}
Column += 1;
}
Row += 1;
}
DisplayMap(Map, MapSize);
Console.writeLine("X marks the spot where the pirate comes ashore");
Console.writeLine();
Console.write("Do you want the pirate to land elsewhere? (Y/N): ");
String Answer = Console.readLine(); // MP3
if (Answer.equals("Y")) {
Row = 0;
int Column = 0;
Console.write("Which row is the pirate coming ashore? ");
Row = Integer.parseInt(Console.readLine()); // MP1
Console.write("Which column is the pirate coming ashore? ");
Column = Integer.parseInt(Console.readLine()); // MP4
boolean OnSand = false;
boolean NextToWater = false;
if (Map[Row][Column].equals(SAND)) { // MP5
OnSand = true;
}
if (Map[Row-1][Column].equals(WATER) || Map[Row+1][Column].equals(WATER)) {
NextToWater = true;
}
if (Map[Row][Column].equals(WATER) || Map[Row][Column-1].equals(WATER)) {
NextToWater = true; // MP2 // MP6
}
if (OnSand && NextToWater) { // MP7
Pirate.Row = Row;
Pirate.Column = Column; // MP8
Map[Row][Column] = PIRATES;
DisplayMap(Map, MapSize); // MP9
} else {
Console.writeLine("That was not a good landing place, so the pirate lands at
X"); // MP10
}
}
}
How to answer it
Question 16: Skeleton Program Modification (Custom Landing Beach)
This Paper 1 question assesses practical programming and system design using the pre-release Skeleton Program:
- Design & Decomposition (AO3): Identifying the required inputs (row/col) and logical criteria for adjacent coordinates (North, South, East, West).
- 2D Array Indexing: Inspecting adjacent elements ( map[row-1, col] , map[row+1, col] , map[row, col-1] , map[row, col+1] ).
- Record/Object & State Mutation: Updating the pirate's location state and updating the map board array.
- Validation Logic: Enforcing compound conditions (must be sand and adjacent to water).
- Program Testing & Verification: Producing accurate terminal evidence matching explicit test harness instructions.
Part 16.1: Subroutine Modification — FindLandingPlace [10 Marks]
Amend the subroutine to allow the user to select an alternate landing coordinate
💡 Key Knowledge: Logic Requirements
A coordinate is a valid beach square if and only if:
- The selected square itself contains Sand ( SAND or '.' depending on constants defined).
- At least one orthogonally adjacent neighbour is Water ( WATER or '~' ):
- North: row - 1, column
- South: row + 1, column
- West: row, column - 1
- East: row, column + 1
🧠 Mark Scheme Breakdown (10 Marks Total)
AO3 Design (2 marks):
- MP1: Identifying the need to prompt and read row and column.
- MP2: Identifying the need to test adjacent squares for water and current square for sand.
AO3 Programming (8 marks):
- MP3: Prompt and receive input for whether to change landing place.
- MP4: Correctly assign integer inputs to row and column variables.
- MP5: Verify current position contains sand.
- MP6: Correctly check orthogonal neighbours for water.
- MP7: Compound check ensuring both sand and water adjacency are met.
- MP8: Update pirate's row and column records.
- MP9: Place pirate token ( PIRATES / 'P' ) on map & call DisplayMap .
- MP10: Output error message if invalid (landing retains default X ).
✅ Correct Implementation (C# / Visual Basic / Python / Pascal Equivalent)
Below is the Python version matching the official AQA mark scheme requirements:
def FindLandingPlace(Map, MapSize, Pirate): # Existing default search for 'X' Found = False Row = 0 while not Found and Row < MapSize.Rows: Column = 0 while not Found and Column < MapSize.Columns: if Map[Row][Column] == 'X': Found = True Pirate.Row = Row Pirate.Column = Column Column += 1 Row += 1 DisplayMap(Map, MapSize) print("X marks the spot where the pirate comes ashore\n") # --- START OF MODIFICATION --- Answer = input("Do you want the pirate to land elsewhere? (Y/N): ") # MP3 if Answer.upper() == "Y": NewRow = int(input("Which row is the pirate coming ashore? ")) # MP1, MP4 NewCol = int(input("Which column is the pirate coming ashore? ")) # MP1, MP4 OnSand = (Map[NewRow][NewCol] == SAND) # MP5 NextToWater = ( # MP2, MP6 Map[NewRow - 1][NewCol] == WATER or Map[NewRow + 1][NewCol] == WATER or Map[NewRow][NewCol - 1] == WATER or Map[NewRow][NewCol + 1] == WATER ) if OnSand and NextToWater: # MP7 Pirate.Row = NewRow # MP8 Pirate.Column = NewCol # MP8 Map[NewRow][NewCol] = PIRATES # MP9 DisplayMap(Map, MapSize) # MP9 else: print("That was not a good landing place, so the pirate lands at X") # MP10 ❌ Common Errors & Examiner Pitfalls
- Off-by-One Array Index Errors: The question guarantees the user will not select edge squares (not row 0/19 or col 0/41), avoiding array bounds exceptions. However, using +1 and -1 on row instead of column (or vice versa) swaps horizontal and vertical checks.
- Overwriting the Pirate Token: Forgetting to place the pirate character ( 'P' ) on the map array prior to re-calling DisplayMap() .
- Overwriting 'X' when input is invalid: If the chosen square is not a beach, the code must leave the pirate landing at 'X' without moving their coordinates.
- Syntax/Semantic penalty: The mark scheme imposes a Max 9/10 cap if there are any syntax errors or incomplete logic.
Part 16.2: Screen Capture — Task 2 (Valid Beach Landing) [1 Mark]
Verification of entering valid coordinates (Row 6, Column 1)
💡 Test Specification
- User Choice: Choose alternate landing place ( Y ).
- Row Entered: 6
- Column Entered: 1
✅ Expected Evidence & Visual Outcome
The screen capture must demonstrate:
- User prompts matching the implementation code from 16.1.
- Inputs Y , 6 , and 1 clearly visible.
- Map re-displayed showing P placed at Row 6, Column 1 (directly adjacent to the western sea border W ).
Part 16.3: Screen Capture — Task 3 (Invalid Landing & Default Fallback) [1 Mark]
Verification of rejection logic and subsequent gameplay
💡 Test Specification
- User Choice: Choose alternate landing place ( Y ).
- Row Entered: 17
- Column Entered: 21 (an inland sand square not adjacent to water).
- Subsequent Moves: Walk ( W ), then 1 square North ( 1N ).
✅ Expected Evidence & Visual Outcome
The screen capture must demonstrate:
- Suitable rejection message (e.g. "That was not a good landing place, so the pirate lands at X").
- The pirate starting at default spot X (Row 18, Column 17).
- After movement input 1N , the map displays the pirate P at Row 17, Column 17.
🧠 Screenshot Checklist for Electronic Answer Document
- Ensure terminal text is legible with high contrast (do not crop out the command prompt entries).
- The test input sequence must be complete in a single run (do not restart the program halfway through).
Topics
4.1 Fundamentals of programming · 4.2 Fundamentals of data structures · 4.13 Systematic approach to problem solving · 4.1.1 Programming · 4.2.1 Data structures and abstract data types · 4.13.1 Aspects of software development
Question and mark scheme from the AQA A-Level Computer Science examination, AS Paper 1, June 2025. QuestionVault is an independent revision resource; questions remain the copyright of the awarding body.