I am working on my title Once in a Lifetime, which accurately calculates years and timeframes.
One thing I’m struggling to figure out a solution to is how I would code in leap year calculations on an if statement.
Typically, leap years are on any year that can evenly end in a 4. I have variables declared for tracking the current year at this time. I was considering a theory of if I could parse out the last digit on the integer (so if it ends in 4), but was unsure how I could implement this.
EDIT: Parsing out any integer that evenly ends on the 4th year, sorry for the confusion!
If anyone has any other methods, please feel free.