*Please HELP me make a program that will determine a 24-hour equivalent from the given input:

Ex: 1:00pm - input
13:00 - output
5:45pm - input
17:45 - output..

*HELP Guyz..PLEASE..for our assignment..tnx alot..God Bless..

Dukane commented: no we do not do homework for students without effort on their part -1

Recommended Answers

All 3 Replies

no will help you do your assignment for you.

if you are stuck post your code and we will help you.

Use the String class. Check its API. Try to recognize if it is am or pm. If it is am then the result is the input, if you remove the last 2 characters:
2:00am - input
2:00 - output

If it is pm, then just add 12 at the hour and then you are ok.

1:00pm - input
Find out if it is pm, then take the 1, then add 12 = 13 then print the 13 and the rest:
13:00

You can use the toChar method to convert the String to an array of characters. Then you can determine what is each character with if statements and calculate the result.

And then you can post some code with what you have so far

*Ok,Thanks a lot..I'm going to try this one..thanks again for the help.. :)..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.