You don't need anything complex for that. Some string manipulation will be enough to validate the time entered in that format; then you just have to convert to the time unit that you need. Remember that 1 minute is 60 seconds, and one hour is 60 minutes. All you have to do is some multiplications to get the whole thing converted to your desired time unit.
Since we don't provide full source code for homework questions, you definitely need to post your code so far so we can all see that you actually know at least the basics of the language, and also to let us know exactly how much help you need.
Remember to use code tags when you post code so it is not hard to read.
You would input your time as a string. You could then use the string::find method to find the colons the user has entered. Separate the numbers that are between the colons as different strings and finally type cast each string to a double.
Kidd106 is right for the most part. Maybe the whole thing, depending on his idea of "type cast". In order to get the string "cast" as a double, you need to use a stringstream object, which is really not a usual type cast.
So, as long as you correctly "cast" the individual numbers to int or double using stringstream, you should be OK.
But since you erased your original question it will never help anyone else. Ruining a thread like this is very bad manners and will cause people to stop helping you. Just saying...