writing pseudocode and problem solving is all part of programming & software development (And if you haven't tried to write pseudocode for this problem yet, then I suggest you give it a go, and see if that helps!), so I'm not going to write a complete comprehensive solution, although, its equally true that the best way to get your head around a problem you've been sweating over is to find a fresh brain to skim over it.
Here's how I would approach the problem:
What does the input look like? You should make sure you have this well-defined. the first hurdle might be string manipulation, eg, if you've got to extract several elements from a string such as "09:45am", then you probably want to search for the delimiter : which seperates the numbers, and extract the two numerical parts as ints, then extract the am/pm suffix to a String
Alternatively, you could leave that bit til last, and just have each part input seperately by the user - in which case, the problem should be more trivial. If your suffix is "am", then the hours remain the same. if your suffix is "pm", then you need to add 12 to your hours. minutes remain the same regardless, and the suffix isn't used in 24hr time.
Finally, what does the output look like? you could simply concatenate hours & minutes for 'military' time format, eg "2315", or perhaps add a seperator in the middle - "23:14".
if string manipulation is proving tricky (String manipulation in java is a bit awkward IMHO), try creating that seperately in another program while you work out how to break up your input to seperate components. good luck!
Last edited by Bench; Nov 4th, 2006 at 5:54 am.