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

Swipe to show menu

book
Challenge: 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

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!

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

book
Challenge: 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

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

Swipe to show menu

some-alt