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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!