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
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