Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a method that returns a message based on the day of the week and the nature of the weather. If the day of the
Write a method that returns a message based on the day of the week and the nature of the weather. If the day of the week is Monday, Tuesday or Wednesday and regardless of the weather, then the message is "It is early in the week, have an early night" If the day of the week is Thursday or Friday and the weather is good, then the message is "Go grab a coffee", else the message is "Go shopping" If the day of the week is Saturday or Sunday and the weather is good, then the message is "Go on a picnic", else the message is "Do some work around the house" whatToDo("Tuesday", true) rightarrow It is early in the week, have an early night whatToDo("Thursday", false) rightarrow Go Shopping whatToDo("Saturday", true) rightarrow Go on a picnic whatToDo("Sunday", false) rightarrow Do some work around the house For example: Test String dayofWeek = "Friday": boolean goodWeather = true: System.out.println("What will I do: " + whatToDo(dayOfWeek, goodWeather)): Result What will I do: Go grab a coffee
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