Welcome to CodeQuest! Help our character, Robo, decide what to do based on the weather. Drag the correct code blocks to complete the program.
Robo wants to know if he should take an umbrella. The weather can be "rainy" or "sunny". Complete the code so Robo reacts correctly!
if (weather === "rainy") {
// Robo takes an umbrella
} else {
// Robo enjoys the sun
}Code Blocks:
weather === "rainy"Robo.takeUmbrella();Robo.enjoySun();
Drag and drop the code blocks into the correct places:
let weather = prompt("Is it 'rainy' or 'sunny'?");
if (__________) {
__________;
} else {
__________;
}
🤖
Try it out:
Open your browser console and run the completed code to see Robo's reaction!
- Use
Robo.takeUmbrella();if it's rainy. - Use
Robo.enjoySun();if it's sunny.
Happy coding!