I am trying to write a method name findNormalizedHour. I want it to implement the following specification:
I am trying to write a method name findNormalizedHour. I want it to implement the following specification:
/**
* Given an hour between 0 and 23 (from 24-hour format),
* convert it to an hour appropriate for 12-hour format
*
* @precondition 0 <= hour <= 23
* @postcondition none
*
* @param hour the hour, in 24-hour format
* @return an hour between 1 and 12, as appropriate
*/
The findNormalizedHour() is a method that converts from a 24-hour format to a 12-hour format. Is there anyway I could get some assistance accomplishing this? I am writing this program in java.
My current code is:
public int findNormalizedHour(int hour) {
return -1;
}
I have provided JAVA CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT-----------------
Step by step
Solved in 4 steps with 4 images