Inicio
/
Tecnología
/
Fill in the Blank: Function Main() ( Let NumRolls = 0; While (true) ( NumRolls++; Let RollOne = Randomizer NextInt(1.6); Let RollTwo =

Problemas

Fill in the blank: function main() ( let numRolls = 0; while (true) ( numRolls++; let rollOne = Randomizer nextInt(1.6); let rollTwo = Randomizer nextInt(1,6): console.log("Rolled: "+rollOne +" + rollTwo); if(rollOne ==1 đết rollTwo ==1) ( __ ;lladd a break statement ) ) console.log("It took you"+ numRolls+"rolls to get snake main(): break0 stopo skipo exito

Roztwór

Adalberto élite · Tutor durante 8 años
Weryfikacja ekspertów
4.7 (263 Votos)

Respuesta

'break'

Explicación

## Step 1The problem is a fill-in-the-blank question related to programming in JavaScript. The code provided is a while loop that continues to execute until a certain condition is met. The condition is that the sum of two random numbers, rollOne and rollTwo, equals 2.## Step 2The while loop is designed to keep running until the sum of rollOne and rollTwo equals 2. This is achieved by incrementing the variable numRolls each time the loop runs.## Step 3The if statement within the while loop checks if the sum of rollOne and rollTwo equals 2. If it does, the loop should stop.## Step 4The blank in the code is where we need to insert the command that will stop the loop. In JavaScript, the command to stop a loop is 'break'.