Ace school

with brainly

  • Get help from millions of students
  • Learn from experts with step-by-step explanations
  • Level-up by helping others

A community for students.

I'm looking at homework 1, optional exercise 1 (Zeller's algorithm). The instructions have a contradiction when the month is Jan or Feb. At one point it says to subtract 1 from C, then it says to use the preceding year. They are not the same--it makes a difference when the year ends in 0, as in the year 2000. If you use the preceding year, year = 2000-1 = 1999; C = 99. But if you subtract 1 from C, year = 2000; C = 0-1 = -1. Any idea which is meant?

MIT 6.189 A Gentle Introduction to Programming Using Python (OCW)
See more answers at brainly.com
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.

Join Brainly to access

this expert answer

SIGN UP FOR FREE
I think I figured this out by looking online. Other explanations of Zeller's algorithm clarified that you actually do use the preceding year--so subtract 1 from the year, then calculate C. One reason I was asking is because I kept getting incorrect output for the years 1000 and 1100 and thought it might have to do with how I was calculating C. I found this explanation online: "This uses the Gregorian calendar, which is our current standard. There are other calendars in use in the world. As the Gregorian calendar was devised in 1582, fixing the cumulative errors of the preceding Julian calendar, it is not clear that Zeller's algorithm will work properly for dates before 1582."

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question