Problemas
Fill in the blank: function main() console.log("Do I need a raincoat?"): //create a variable that stores whether or not it is raining and use the Randomizer to assign a random Boolean value __ console.log(isRaining); if (isRaining) ( console.log("It's raining. Yes you need your raincoat."); else ( console.log("No, you do not need a raincoat "): main(): let isRaining=Bool.randomO isRaining=Randomizer.nextBoolean() Randomizer.nextBoolean() let isRaining=Randomizer.nextBoolean()
Roztwór
Angela
maestro · Tutor durante 5 años
4
(227 Votos)
Respuesta
The correct answer is:```javascriptlet isRaining = Randomizer.nextBoolean();console.log(isRaining);if (isRaining) { console.log("It's raining. Yes you need your raincoat.");} else { console.log("No, you do not need a raincoat.");}```Explanation:The question is asking to fill in the blank in the given JavaScript code to create a variable that stores whether or not it is raining and use the Randomizer to assign a random Boolean value. The correct answer is to use the `let` keyword to create a variable named `isRaining` and assign it the value of `Randomizer.nextBoolean()`. This function returns a random Boolean value, either `true` or `false`. The variable `isRaining` is then used in the `if` statement to determine whether or not it is raining and whether or not the user needs a raincoat.