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

Sveip for å vise menyen

book
Challenge: Weather-Based Outfit Recommender

Oppgave

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.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 4

Spør AI

expand
ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

book
Challenge: Weather-Based Outfit Recommender

Oppgave

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.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 3. Kapittel 4
Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Vi beklager at noe gikk galt. Hva skjedde?
some-alt