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
We're sorry to hear that something went wrong. What happened?

Ask AI

expand
ChatGPT

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

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
Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
We're sorry to hear that something went wrong. What happened?
some-alt