Developing Software Solutions

 

 

 

 

 

 

 

 

 

 

 

Easter Algorithm

 

                To explain what the algorithm does, we will calculate the date for 1992.

                There are 10 divisions that need to be done.

 

 

I                                                                 remainder       16                                A = 16

 

II                                                               remainder       92                                B = 19

                                                                                                                                                C = 92

 

III                                                              remainder       3                                  D = 4

                                                                                                                                                E = 3

 

IV                                                              remainder       15                                F = 6

 

V                                           remainder       28                                G = 28

 

VI                                                              remainder       5                                  H = 1

 

VII                                                            remainder       0                                  J = 23

                                                                                                                                                K = 0

 

VIII                      remainder       1                                  M = 1

 

IX                                                   remainder       18                                N = 4

 

X                                  remainder       19                                P = 19

 

 

 

Easter Sunday is the Pth day of the Nth month for Year

19th  April  1992                 Check it!

 


 

Here is a summary of the ten equations

 

 

 

 

 

Check that the years 1818 and 2285 give Easter Sunday as 22nd March

 and 1886, 1943 and 2038 give Easter Sunday as 25th April

 

 

 

Exercise 11.1

 

Write a Pascal program that will do these ten calculations

 

MOD and DIV are special functions that you will need

Eg

 

A:=Y MOD 19;

B:=Y DIV 100;

 

This is due on 14th March

 

    

Hosted by www.Geocities.ws

1