Question: This is a JAVA Program. Write a program that converts from the 24-hour time format to the 12- hour time format. The following is a
This is a JAVA Program.
Write a program that converts from the 24-hour time format to the 12- hour time format. The following is a sample dialogue (user input is underlined) : Enter time in 24-hour notation: 13:07 That is the same as 1:07 PM Again? (y) Y Enter time in 24-hour notation: 10: 65 That is not a valid time Try again: 10:35 That is the same as 10:35 AM Again? (y) N End of program Define an exception class called TimeFormatException so that if the user enters an illegal time, like 10:65, your program will throw, catch, and handle a TimeFormatException exception. Your program should also be able to handle an appropriate exception for gibberish entries, like &&*68, and so on
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
