Skip to content

The Math Class

Introduced
Handout Watch lesson

Trace a random range at both ends

  • Tickets need integer labels from 4 through 9 inclusive. Use (int)(Math.random() * 6) + 4.
  • Scaling gives values from 0 up to but not including 6; truncating gives 0 through 5; shifting gives 4 through 9.
Trace a random range at both ends

Handout

Log in or create account

IGCSE, A-Level & AP