Question: In Java hour and min variables are integers. Use switch/case and the variable hour and minute to display The current time is 08:08 in the

In Java

hour and min variables are integers.

Use switch/case and the variable hour and minute to display "The current time is 08:08 in the MORNING." if hour is equal to 5-10, "The current time is 13:10 in the AFTERNOON." if hour is equal to 11-16, "The current time is 20:30 in the EVENING." if hour is equal to 17-22, "The current time is 01:45 in the NIGHT." if hour is equal to 23-4, and " You have the wrong time." if hour is something other than 0-23. Note: The hour and minute values will be different since they are dynamic and based on the system clock. Make sure you test your switch for all possible values.

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!