You can compute the date for any Easter Sunday from 1900 to 2099 as follows (all
ID: 3761491 • Letter: Y
Question
You can compute the date for any Easter Sunday from 1900 to 2099 as follows (all variables are of type integer): a is the year modulus 19 b is the year modulus 4 c is the year modulus 7 d is (19*a+24) modulus 30 e is (2*b+4*c+6*d+5) modulus 7 Easter Sunday is March (22+d+e) – Note that this formula can give a date in April. There are four years (1954, 1981, 2049, and 2076) for which the algorithm gives a date that is seven days later than it should be. For these years subtract seven from the day of the month. This correction does not cause the month to change. Write a program that inputs a beginning year and an ending year and outputs a chart of Easter Sundays. A sample run looks as follows: Press after each piece of input data! Please input the beginning year for the chart (1900-2099)? 1950 Please input the ending year for the chart (1900-2099)? 2000 Easter Sunday Chart ---------------------------- Year Date ------- ------- 1950 xxxxxxxxxx 1951 xxxxxxxxxx 1952 xxxxxxxxxx . . . . 1999 April 4 2000 April 23
Explanation / Answer
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.