Project 2: | Problem | Solution |
CSE 1503 Introduction to Computer Programming
with FORTRAN
Section 1 & 2 Due Date: March 02, 1999
|
![]() |
PROBLEM
Program Leap Easter (1) takes an INTEGER variable called Year as an input, (2) determines if that year is a leap year, (3) calculates the Easter day of that year, (4) prints the results. How-To calculate the Leap Year A year is a leap year either if it is divisible by 4 but not by 100 or divisible by 400. Thus, 1990 is not a leap year since it is not divisible by 4; year 1900 is not a leap year since it is divisible by 4 and by 100; year 1996 is a leap year since it is divisible by 4 but not by 100; and year 2000 is a leap year since it is divisible by 400. Assume that the result of the above condition or test is stored in a LOGICAL variable name called LEAP. How-To calculate the Easter Day The Easter Day is the first Sunday after the first full moon, on March 21st or later. However, to write a Fortran program determining Easter Day based on the previous input is not within the scope of this course. T. H. O'Berine discovered a simple method to find out the Easter Day
between 1900 and 2099 inclusive. Let
Year be a year between
1900 and 2099 inclusive. You should calculate both values for Day
and
Month in order to determine the Easter Day.
How-To calculate Day The following table gives all necessary steps to find the value of Day:
In the table above, the column labeled Dividend is divided by the number in the Divisor column, giving either a quotient or a remainder. The procedure goes as follows:
To determine the value of Month, follow the rules below:
For example: If Year is 1997, then Day takes a value of -1 at step 6 above. The new Day becomes Day + 31 = (-1) + 31 = 30 and Month is March.
Allow user to input more than one year on a single execution. If user enters a year not within the range of 1900 and 2099 inclusive, stop program. OUTPUT EXAMPLES Enter a Year value between 1900 and 2099 inclusive?
NOTES
PROGRAM Leap Easter
|