Understanding Arrays and Strings
DOI link for Understanding Arrays and Strings
Understanding Arrays and Strings book
Professor: I’m curious to find out when next Easter and Thanksgiving come. Did you write your programs?
Mike: There are actually many different algorithms for calculating the date of Easter and we just picked up the first one that looked trustworthy. Basically, we just copied and pasted it but as it was written in some other language (I think it was Python) we were confused by the double slash operators (//), which weren’t comments. We discovered that they are actually divisions except that they neglect the remainder. So we replaced themwith ordinary divisions and rounded down the quotient to the nearest integer using Math.floor(). This is our solution:
Professor: You’ve done a great job. Did you try to decipher what the calculations are all about?