7.2 Computational Methods (OCR A Level Computer Science)

Exam Questions

6 mins3 questions
11 mark

Fig. 5 shows a graph data structure representing a small section of a parcel delivery network. Each node represents an address where deliveries need to be made. The edges show the possible routes and distances between these deliveries.

Graph with nodes labelled A to H connected by edges with weights 3, 7, and 11. Key connections: D-H (11), B-E (3), D-C (3), E-F (3).

State why performance modelling is used to test a system.

Did this page help you?

23 marks

A Nonogram is a logic puzzle where a player needs to colour in boxes. The puzzle is laid out as a grid and each square needs to be either coloured black or left white.

The numbers at the side of each row and column tells the player how many of the boxes are coloured in consecutively. Where a row has two or more numbers, there must be a white square between the coloured squares.

A 5x5 nonogram puzzle grid with black and white squares. Numbers on the right and bottom indicate sequences of contiguous black squares.

In this example:

  • the first column has 1 1, this means there must be two single coloured boxes in this column. There must be at least 1 white box between them.

  • the first row has 2, this means there must be two consecutively coloured boxes in the row.

Juan is creating a program that will store a series of Nonograms for a user to play. The game will randomly select a puzzle and display the blank grid with the numbers for each row and column to the user

The user plays the game by selecting a box to change its colour. If the box is white it will change to black and if it is black it will change to white. The user can choose to check the answer at any point, and the game will compare the grid to the answers and tell the user if they have got it correct or not.

Juan is creating a structure diagram to design the game.

Complete the structure diagram by adding another layer for New game, Play game and Check answer.

Flowchart showing "Nonogram" at the top, branching into "New game," "Play game," and "Check answer" with empty boxes below each.

Did this page help you?

32 marks

Explain why decomposing a problem can help a developer design a solution.

Did this page help you?