using 17:05 (time) format in if/else statement

If I wanted to use time for a if/else statement or say a conditional expression like this. How would I go about doing it, obviously I want the user to put time as 17:05 format. so how would I have write the statement below to appear correctly for the user input.

 
 cout << " Two Mile Run you: \n" << (score > 17.05 ? "failed." : "Passed.");
Last edited on
closed account (48T7M4Gy)
Convert the user input (as a string ) to a float value is probably the easiest. Use the ':' character to separate the hours and minutes, then hh:mm becomes hh+(mm/60)
Topic archived. No new replies allowed.