Please enable JavaScript to use CodeHS

  • Autograded
  • Featured

Calculating Easter

Easter doesn't happen on the same date from year to year. In this project, you will write a program that calculates the date of Easter on a given year.

Medium

1 Hour

High School

Project Description


Background

The date of Easter follows the lunar calendar. A lunar year is 12 moon cycles long, where each moon cycle is around 29 ½ days. Therefore, a lunar year is only 354 days long — 11 days shorter than our usual 365-day calendar year.


Due to the difference in year length, the date of Easter is on the first Sunday after a full moon after the spring equinox. Spring equinox is when the sun is directly above the earth’s equator, resulting in the length of day and night being equal. The spring equinox is always on March 21. Therefore, the Sunday following the full moon after March 21 is when we celebrate Easter. Given this, Easter always falls between March 22 and April 25.


Assignment

Write a function that takes the year as a parameter and returns a string of the date of Easter Sunday for the given year. Easter Sunday is the first Sunday after the first full moon of spring. Use the algorithm invented by the mathematician Carl Friedrich Gauss in 1800 to calculate the date.

Project Demo

Explore this program before assigning it!

Project Overview

Here is an outline of the project activities: