In the sugar town of friendly north, a cane harvesting festival is held every 6th year.These celebrations began in the year 1980. Given a future period- defined by a start year and an end year- write a program to determine the years in which the festival is celebrated.
The program should accept as input a start year and end year to indicate the period being considered. your program should check;
- start year is 1980 or greater
- end year is greater than start year
my piece of code is given below. can any one tell how to add six to the start year till the end year approaches.
#include <iostream>
usingnamespace std;
double start_year;
double end_year;
char response='y';
int main()
{
while (response=='y' || response=='Y' ) // if resonpse is yes then excute the program again
{
cout<<"Welcome to Friendly North Festival Calender\n"<<endl;
cout<<"Please enter the start year => ";
cin>>start_year;
cout<<"Please enter the end year => ";
cin>>end_year;
cout<<"During the period " << start_year<< " - " <<end_year<<endl;
cout<< "The Friendly North Festival will be celebrated in:"<<endl;
cout << "\tDo You Want To Run This Program Again [Y/N] ";
cin >> response;
}
system ("PAUSE");
return 0;
}
In the sugar town of friendly north, a cane harvesting festival is held every 6th year.These celebrations began in the year 1980. Given a future period- defined by a start year and an end year- write a program to determine the years in which the festival is celebrated.
The program should accept as input a start year and end year to indicate the period being considered. your program should check;
- start year is 1980 or greater
- end year is greater than start year
my piece of code is given below. can any one tell how to add six to the start year till the end year approaches.
#include <iostream>
usingnamespace std;
double start_year;
double end_year;
char response='y';
int main()
{
while (response=='y' || response=='Y' ) // if resonpse is yes then excute the program again
{
cout<<"Welcome to Friendly North Festival Calender\n"<<endl;
cout<<"Please enter the start year => ";
cin>>start_year;
cout<<"Please enter the end year => ";
cin>>end_year;
cout<<"During the period " << start_year<< " - " <<end_year<<endl;
cout<< "The Friendly North Festival will be celebrated in:"<<endl;
cout << "\tDo You Want To Run This Program Again [Y/N] ";
cin >> response;
}
system ("PAUSE");
return 0;
}
if you want help you let me know buddy, im offering it.
Um, of course the OP wants help. That's why they're posting the thread. So why don't you give them your help right here in the thread, where it was asked for?