Skip to content · ⁨Pular para o conteúdo⁩

The Math Class · ⁨A Classe Math⁩

Handout · ⁨Material de apoio⁩ Watch lesson · ⁨Assistir aula⁩

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 · ⁨Material de apoio⁩

Log in or create account · ⁨Entrar ou criar conta⁩

IGCSE, A-Level & AP