Challenge: Weather Adviser
Swipe to start coding
You are developing a weather application that classifies the current outdoor temperature and provides suitable advice based on the temperature category. You have a variable temperature
, representing the current outdoor temperature in degrees Celsius.
- If
temperature
is above30
, assign'Hot'
toweather_status
. - If
temperature
is between15
and30
(inclusive), assign'Warm'
toweather_status
. - If
temperature
is between0
and14
(inclusive), assign'Cool'
toweather_status
.
Based on the determined weather_status
, assign suitable outdoor advice
- If
weather_status
is'Hot'
, assign'Stay hydrated'
tooutdoor_advice
. - If
weather_status
is'Warm'
or'Cool'
, assign'Great weather for a walk'
tooutdoor_advice
. - Otherwise (
weather_status
is'Cold'
), assign'Wear a coat'
tooutdoor_advice
.
Solution
Thanks for your feedback!
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Summarize this chapter
Explain the code in file
Explain why file doesn't solve the task
Awesome!
Completion rate improved to 1.67
Challenge: Weather Adviser
Swipe to show menu
Swipe to start coding
You are developing a weather application that classifies the current outdoor temperature and provides suitable advice based on the temperature category. You have a variable temperature
, representing the current outdoor temperature in degrees Celsius.
- If
temperature
is above30
, assign'Hot'
toweather_status
. - If
temperature
is between15
and30
(inclusive), assign'Warm'
toweather_status
. - If
temperature
is between0
and14
(inclusive), assign'Cool'
toweather_status
.
Based on the determined weather_status
, assign suitable outdoor advice
- If
weather_status
is'Hot'
, assign'Stay hydrated'
tooutdoor_advice
. - If
weather_status
is'Warm'
or'Cool'
, assign'Great weather for a walk'
tooutdoor_advice
. - Otherwise (
weather_status
is'Cold'
), assign'Wear a coat'
tooutdoor_advice
.
Solution
Thanks for your feedback!
Awesome!
Completion rate improved to 1.67single