← Back to If Statements
Question 242
Coat Or Umbrella
Coat Or Umbrella
Read a temperature and then a yes or no answer to whether it is raining, and give advice using nested ifs: when raining, below 10 degrees prints Coat and umbrella and otherwise Umbrella; when dry, below 10 degrees prints Coat and otherwise No coat needed. Input: two lines, the temperature as an integer then the answer, no prompts. Output: one line.
Expected Output:
Coat and umbrella= newline. The output ends with a newline — print one after the last line.
Hints3 available
Sign in to use hintsTopics:
If Statements
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (pr, inp, def)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.