Discover a world of knowledge at Westonci.ca, where experts and enthusiasts come together to answer your questions. Get quick and reliable solutions to your questions from a community of seasoned experts on our user-friendly platform. Discover detailed answers to your questions from a wide network of experts on our comprehensive Q&A platform.

in this program we ask the user to enter a time in military time (24 hours). the program will convert and display the equivalent conventional time (12 hour with am or pm) for each entry if it is a valid military time. an error message will be printed to the console if the entry is not a valid military time. think about how you would convert any military time 00:00 to 23:59 into conventional time. also think about what would be valid military times. to be a valid time, the data must have a specific form. first, it should have exactly 5 characters. next, only digits are allowed in the first two and last two positions, and that a colon is always used in the middle position. next, we need to ensure that we never have over 23 hours or 59 minutes. this will require us to separate the substrings containing the hours and minutes. when converting from military time to conventional time, we only have to worry about times that have hours greater than 12, and we do not need to do anything with the minutes at all. to convert, we will need to subtract 12, and put it back together with the colon and the minutes, and indicate that it is pm. keep in mind that 00:00 in military time is 12:00 am (midnight) and 12:00 in military time is 12:00 pm (noon).