Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started