Answered step by step
Verified Expert Solution
Link Copied!

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 - M5 Homework: Weather Advice
No Comments
Write a complete program to give advice on clothing/accessories based on the weather. Your program should accomplish these steps, in order:
Part One: User Input (8 points)
ask the user what the temperature is and read in that value
ask the user if there is precipitation (i.e., rain or snow)
you can decide how to phrase that question and what to read in
Part Two: Weather Advice Output (17 points)
3. 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 (10 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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago