Photo AI

The following subroutines control the way labelled blocks are placed in different columns - AQA - GCSE Computer Science - Question 13 - 2021 - Paper 1

Question icon

Question 13

The-following-subroutines-control-the-way-labelled-blocks-are-placed-in-different-columns-AQA-GCSE Computer Science-Question 13-2021-Paper 1.png

The following subroutines control the way labelled blocks are placed in different columns. BLOCK_ON_TOP(column) returns the label of the block on top of the column ... show full transcript

Worked Solution & Example Answer:The following subroutines control the way labelled blocks are placed in different columns - AQA - GCSE Computer Science - Question 13 - 2021 - Paper 1

Step 1

Draw the final arrangement of the blocks after the following algorithm has run.

96%

114 rated

Answer

After executing the commands, the following arrangements will occur:

  1. After MOVE(0, 1): Block C moves from Column 0 to Column 1.

    Column 0 Column 1 Column 2 A C B

  2. After MOVE(0, 2): Block A moves from Column 0 to Column 2.

    Column 0 Column 1 Column 2

    C A B

  3. After MOVE(0, 2): There are no more blocks in Column 0 to move, so the arrangement remains the same.

Final Arrangement:

Column 0 Column 1 Column 2

C A B

Join the GCSE students using SimpleStudy...

97% of Students

Report Improved Results

98% of Students

Recommend to friends

100,000+

Students Supported

1 Million+

Questions answered

;