Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Weather-Based Outfit Recommender | Conditional Statements
Introduction to JavaScript

bookChallenge: Weather-Based Outfit Recommender

Task

Swipe to start coding

Write a program that suggests the user what to wear based on the weather conditions.

Use if-statements to check the weather and display an outfit recommendation:

  • If the weather is "sunny", print: "Wear sunglasses and a t-shirt!".
  • If the weather is "rainy", print: ``"Take an umbrella and wear a raincoat!".
  • If the weather is "cold", print: "Wear a warm jacket and a scarf!".

Note

Use the strict checks in the boolean expression.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 3. ChapterΒ 4
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

close

Awesome!

Completion rate improved to 1.33

bookChallenge: Weather-Based Outfit Recommender

Swipe to show menu

Task

Swipe to start coding

Write a program that suggests the user what to wear based on the weather conditions.

Use if-statements to check the weather and display an outfit recommendation:

  • If the weather is "sunny", print: "Wear sunglasses and a t-shirt!".
  • If the weather is "rainy", print: ``"Take an umbrella and wear a raincoat!".
  • If the weather is "cold", print: "Wear a warm jacket and a scarf!".

Note

Use the strict checks in the boolean expression.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

close

Awesome!

Completion rate improved to 1.33
SectionΒ 3. ChapterΒ 4
single

single

some-alt