I need to write a program that takes two years that are input by the user and output every easter sunday in between those years. the problem is that I don't get how I'm supposed to display the years in between the input years. im completely at a loss as to what I should be doing, i guess i dont really understand loops all that well.
#include <iostream>
#include <iomanip>
#include <cmath>
#include <string>
usingnamespace std;
int main()
{
int a;
int b;
int c;
int d;
int e;
int yearone;
int yeartwo;
int sunday;
string month;
int count;
int maxcount;
bool datavalid;
a = yearone%19;
b = yearone%4;
c = yearone%7;
d = (19*a+24)%30;
e = (2*b+4*c+6*d+5)%7;
sunday = (22+d+e);
cout<<"Press <ENTER> after each piece of input data."<<endl;
cout<<endl;
cout<<"Please input the beginning year of the chart (1900-2099)."<<endl;
cin>>yearone;
cout<<"please input the ending year of the chart (1900-2099)."<<endl;
cin>>yeartwo;
cout<<endl<<endl;
if (yearone>=1900 && yeartwo<=2099)
datavalid=true;
else
{ cout<<"You have entered an incorrect starting and/or ending year program terminated."<<endl;
return 1;
}
if (sunday>31)
month="April";
else
month="March";
count = 1;
maxcount = (yearone-yeartwo);
while (count<maxcount)
{
cout<<"EASTER SUNDAY CHART"<<endl;
cout<<"-------------------"<<endl;
cout<<setw(4)<<month<<setw(10)<<sunday<<endl;
count++;
}
system("PAUSE");
return 0;
}