Question: tory Window Canvas - M 5 Homework: Weather Advice No Comments Write a complete program to give advice on clothing / accessories based on the
tory
Window
Canvas M Homework: Weather Advice
No Comments
Write a complete program to give advice on clothingaccessories based on the weather. Your program should accomplish these steps, in order:
Part One: User Input points
ask the user what the temperature is and read in that value
ask the user if there is precipitation ie rain or snow
you can decide how to phrase that question and what to read in
Part Two: Weather Advice Output points
display information about the precipitation based on these rules:
if there is no precipitation, tell the user that is dry
if there is precipitation, use the temperature to tell the user if it is raining or snowing
display advice to the user about what to wear, following these rules
if it is very cold, wear a heavy coat; if it's moderate, wear a light coat
if there is precipitation: wear a hat if it's very cold wear a warm rain coat if it's moderate or bring an umbrella if it's warm
Note: you can decide how to define your temperature ranges.
Note: if you need to compare text values Strings you can use an expression like this, which returns a boolean:
Additional Coding Requirements points
choose the conditional structure that is a good logical match for the task
write your conditional in a way that reduces duplicated or repeated code
use constants when appropriate for example, to define your temperature ranges
follow Java naming conventions for variables lower camel case with no underscores
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
