2 Antworten
+ 10
mohammed akallaa ,
to see what your issue is, we need to see your attempt.
> please link your code here.
> also give a description what problem do you have
+ 9
mohammed akallaa ,
here some hints how it could be done:
the best way is to break both times down to minutes, calculate the diff, and get hours and minutes of this.
> take input from *start time*, strip off spaces, split it in hours and minutes, convert each to integer.
> do the same with *end time*.
> (for start and end): use hours and minutes and calculate each to total minutes.
> calculate the difference of end_total_minutes - start_total_minutes.
> use this difference from last step and get now hours and minutes by using 2 divisions (// division and % division).