Take for example you want to convert 7520 seconds into hh:mm:ss. Use integer math
To get hours: hr = sec/(60*60); // int math truncates What's left is: sec = sec - (hr*(60*60)); // remove the #hrs Or using mod: sec = sec % (60*60)); // gives remainder if hrs divided out From here you should be able to do minutes, then figure out how to do your project. It's the same.
Sorry, if im being difficult. I don't understand what is going on here
Thanks for your help so far, I do understand this more than I did 30 mins ago.
Edit: I understand whats going on as far as 60*60 = 3600 and thats how many seconds are in an hour. I still dont get how to use this for going from hours to days
I showed you how it works for hh:mm:ss from seconds. Your task is to do weeks, days, hours from hours.
It's the same procedure with different numbers. How many hours in a day? How many hours in a week?
Help! I want to create a java program that finds the highest even integer among the values entered by the user. Stop asking values when a value less than 1 have been entered. If no even integer is entered, display "No Even Integer"
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...