4.15 Method overload Challenge

Hello, I hope you have been successful,We will do it step by step to make it work. I went to the challenge file, I'm just going to show it on the screen and every time I want to go back and check, you'll be able to follow along I'll just show it on the screen and whenever I want to go back and check it, you can follow along, First of all, you can see that I've already created a class called challenge. We'll start by creating our getDure method, public static String being a data that we will return a string as specified in the instruction,In parameter, we will see the minute in integer and second in integer. We have to make sure that the string returns something that represents the hours minutes and seconds So what we want to do first is to start with some validation, as in the instruction. some validation, as in the instruction, Minutes is greater than 0, Seconds is greater than 0, Seconds is lower 59. We'll use our if condition. If minute in parenthesis is lower than 0 and second lower than 0 in If our condition is true we return a string that says "invalid value". string that says "invalid value". If the two variables minutes and seconds are valid we go to the step it is ad aire, convert the total of minutes passed to this method in 2 of minutes spent in this method into 2 hours. We'll do this by creating another variable varhour equal to minute divide 60 Now we have to calculate the remaining minutes. have for example 61 minutes, that makes 1 hour and 1 minute so we have to calculate how many minutes can fit in one hour, so minutes can fit in an hour, so we created another variable varminut equals minute modulo 60 this is the number of minutes left now we'll return our string varhour plus h in quotes which correspond to hours plus minutes plus varMinute plus m which corresponds to minutes and then in quotes plus seconds plus s in quotes that correspond to seconds Now before writing the next overloaded version of this method, we'll test it first so I'll call our getHard method. call our getDure method we'll pass 65 as the number of minutes and 45 as the number of seconds, we execute to make sure it works, as you can see, we have a result of one hour 5 minutes 45 seconds