Question
Write a Java program (code + screenshot of output) that takes a user input temperature and weather and displays an output as follows: Weather Temperature
Write a Java program (code + screenshot of output) that takes a user input temperature and weather and displays an output as follows: Weather | Temperature | Output | |
ANY (sunny OR cloudy) | temperature > 40 | Stay at home | |
sunny | 40 temperature > 25 | Go to the mall | |
cloudy | Go to the park | ||
sunny | 25 temperature > 15 | Stay in the shade | |
cloudy | Have a BBQ party | ||
sunny | 15 temperature | Walk under the sun | |
cloudy | Keep warm |
Sample run1:
Please input the weather (sunny OR cloudy): sunny
Please input the temperature: 50
Stay at home
Sample run2:
Please input the weather (sunny OR cloudy): cloudy
Please input the temperature: 50
Stay at home
Sample run3:
Please input the weather (sunny OR cloudy): sunny
Please input the temperature: 40
Non-Business Use
Go to the mall
Sample run4:
Please input the weather (sunny OR cloudy): cloudy
Please input the temperature: 26
Go to the park
Sample run5:
Please input the weather (sunny OR cloudy): sunny
Please input the temperature: 25
Stay in the shade
Sample run6:
Please input the weather (sunny OR cloudy): cloudy
Please input the temperature: 16
Have a BBQ party
Sample run7:
Please input the weather (sunny OR cloudy): sunny
Please input the temperature: 15
Walk under the sun
Sample run8:
Please input the weather (sunny OR cloudy): cloudy
Please input the temperature: 5
Keep warm
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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