Obviously totalYears % 365 is not correct. Imagine I enter the exact number of minutes in 1 year. The output should by 1 year and 0 days. However 1 % 365 = 1. What you need to do is a subtraction....