Random Number Generation (AQA GCSE Computer Science)

Exam Questions

9 mins4 questions
11 mark

Define random number generation in the context of programming.

Did this page help you?

21 mark

Identify once choice to which of the following are NOT examples of where random number generation can be used.

  • Sorting a list of numbers in ascending order

  • National lottery

  • Cryptography

  • Simulating the roll of a dice

Did this page help you?

12 marks

Write pseudocode that simulates the roll of a dice, generating and outputting a random number between 1 and 6.

Did this page help you?

15 marks

Write a Python program that generates a 6-digit random code and asks the user to input their username and password.

If the username is “admin” and the password is “secure123”, display the generated code.

If the input is incorrect, display an error message.

Did this page help you?