CSC103 - Project 1
Due Wednesday Oct 4th at the start of class
The following algorithm calculates the date of Easter given the year (for any year after 1583). Easter falls on the first Sunday following the first full moon on or after March 21. The algorithm is due to Gauss. Implement the algorithm in C+=. All the variables are integers and their identifiers are written below in italics.
1. Prompt the user for Year and get the value.
2. Add 1 to the quotient of Year divided by 100 and assign the result to Century.
3. Subtract 12 from the quotient of (3*Century) divided by 4 and assign the result to Gregor. (Gregor is the "Gregorian correction" - it is the number of years 1700, 1800, etc., when leap year is skipped.)
4. Add one to Year modulo 19 and assign the result to Moon. (Moon is the "Golden number" used to determine the position of the moon.)
5. Calculate the quotient of (8*Century + 5) divided by 25 and then subtract (5 + Gregor). Assign the result to Clavian. (Clavian is the "Clavian correction" which is approximately 8 days every 2500 years.)
6. Calculate the quotient of (5*Year) divided by 4 and then subtract (Gregor + 10). Assign the result to e. (e is a temporary value.)
7. Calculate (11*Moon + 20 + Clavian) modulo 30 and assign the result to Epact. (Epact is the age of the moon on January 1.)
8. If (Epact = 25 and Moon > 11) or if Epact = 24, then add 1 to Epact.
9. Assign 44 minus Epact to Day.
10. If Day < 21, then add 30 to Day.
11. Subtract (Day + e) modulo 7 from (Day + 7). Assign the result to Day.
12. If Day <= 31, then Easter is March Day. Otherwise Easter is April (Day - 31). Display the month and day of Easter.
Try the program on several dates such as: 1800 (April 13), 1802 (April 18), 1803 (April 10), 1951 (March 25), 1991 (March 31), 1993 (April 11), and 2000 (April 23).
Name your program Easter.cpp. Submit a listing of the program and a disk containing the program.
The project will be graded on a 50 point basis and 5 points will be deducted for each day late (except Sunday).