Question bank › GCSE Computer Science › Programming

Input/output & random number generation

Answer on paper first, then reveal the mark scheme one mark at a time.

1Grade 8–96 marks

Write a program, using AQA pseudocode, that simulates rolling two six-sided dice. The program should:

  • keep rolling both dice until a double (both dice the same value) is rolled
  • then output how many rolls were needed.

You should use the subroutine RANDOM_INT(a, b), which returns a random integer between a and b inclusive. [6]

Still losing marks on this topic?

Book a free introductory session and we'll find exactly which step is costing you.

Book a free intro