hello I am new to the forum and to java and i have a program that the user inputs the time followed by am and pm and the program changes it to military time. at the end the program asks if you want to rerun the program. the program works when i enter no but i cant figure out how to get it to work if the user enters yes. also if the time is am the military time is the same as the input except there is a 0 in front. i cant figure out how to output the 0. +0 wont work :mad::mad::mad::mad::mad: i have added my code below!

Hello, your problem with the zero is the fact that you store the hour in an int, the int cannot start with a zero, there would be no point in that so you need to read in the hour and after your conversion to 24h format look at the digit and if it's less than 10 you need to add a zero before it and remember to store it as a string to keep the initial zero.