Write a program that converts a time from 24–hour notation to 12–hour notation. The following is a sample interaction between the user and the program:
Enter time in 24–hour notation:13:07That is the same as 1:07 PMAgain? (y/n)YEnter time in 24–hour notation:10:15That is the same as 10:15 AMAgain? (y/n)YEnter time in 24–hour notation:10:65There is no such time as 10:65Try Again:Enter time in 24–hour notation:16:05That is the same as4:05 PMAgain?(y/n)nEnd of program
Define an exception class called TimeFormatException. If the user enters an illegal time, like 10:65, or even gibberish,like 8&*68, your program should throw and handle a TimeFormatException.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.