CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{
	int N,d;
	cin >> N >> d;
	int num;
	if(N%4 == 0){
		if(N%100==0){
			if(N%400==0){
				num=366;
			}
			else{
				num=365;
			}
		}
		else{
			num=366;
		}
	}
	else{
		num=365;
	}

		if(d<7){
			//int a=7-d;
			cout << "Month 1:" << " " << 7-d+1 <<" ";
			d=7-d+1;
		}
		else{
			cout << "Month 1:" << " " <<  d << " ";
		}
		d=d+7;
		while(d<=31){
			cout << d << " ";
			d+=7;
		}
		cout << endl;
		d=d-31;
		if(num==365){
			cout << "Month 2:" << " ";
			while(d<=28){
				cout << d << " ";
			        d=d+7;
			}
			cout << endl;
			d=d-28;
		}
		else{
			cout << "Month 2:" << " ";
			while(d<=29){
				cout << d << " ";
				d=d+7;
			}
			cout << endl;
			d=d-29;
		}
		cout << "Month 3:" << " ";
		while(d<=31){
			cout << d << " " ;
			d+=7;
		}
		cout << endl;
		d=d-31;

		cout << "Month 4:" << " ";

		while(d<=30){
			cout << d << " ";
			d+=7;
		}
		cout << endl;
		d=d-30;

		cout << "Month 5:" << " ";
		while(d<=31){
			cout << d << " ";
			d+=7;
		}
		cout << endl;
		d=d-31;

		cout << "Month 6:"<< " ";
		while(d<=30){
			cout << d << " ";
			d+=7;
		}
		cout << endl;
		d=d-30;

		cout << "Month 7:" << " ";
		while(d<=31){
			cout << d << " ";
			d+=7;
		}
		cout << endl;
		d=d-31;

		cout << "Month 8:" << " ";
		while(d<=31){
			cout << d << " ";
			d+=7;
		}
		cout << endl;
		d=d-31;

		cout << "Month 9:" << " ";
		while(d<=30){
			cout << d <<" ";
			d+=7;
		}
		cout << endl;
		d=d-30;

		cout << "Month 10:" << " ";
		while(d<=31){
			cout << d << " ";
			d+=7;
		}
		cout << endl;
		d=d-31;

		cout << "Month 11:" << " ";
		while(d<=30){
			cout << d << " ";
			d+=7;
		}
		cout << endl;
		d=d-30;

		cout << "Month 12:" << " ";
		while(d<=31){
			cout << d << " ";
			d+=7;
		}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program {
	int N , d;
	cin >> N >> d;

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{
	int y,d,p;
	cin>>y>>d;
	p=y%400;

	if(p==0){
		cout<<"month 1";
	while(d<31){
		d=d+7;
			cout<<d;
	}}}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program
{
	int N, d;
	cin>>N>>d;
	bool yleap;

	if (N%4==0)
	{ 
		if(N%100==0 && N%400==0)
		:WQ
	 	 yleap=true;
	        else if(N%100==0)
		yleap=false;
	        else 
		yleap= true;
	}
        if (yleap==true)
	 {
		 if(d==1)

}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{
	int y,d;
	cin >> y >> d;
	float x=y%4;
	float z=y%400;

		cout <<"Month 1: ";
			int b=d;
			int l=7-d+1;
			while((l<32) && (l>0)){	
			cout << l << " ";
			l=l+7;
			}
			cout << endl;
	
		
		cout << "Month 2: ";
		int c=l-31;
		int t=29;
		if(((x==0) && (z==0)) || ((y==0) && (y%100!=0))){
			t=30;
		}
		
		while((c<t) && (c>0)){
		cout << c << " ";
		c=c+7;
		}
		
		cout << endl;

		
		cout << "Month 3: ";
		int j=28;
		if(((x==0) && (z==0)) || ((y==0) && (y%100!=0))){
			j=29;
		}
		int e=c-j;
		while((e<32) && (e>0)){
			cout << e << " ";
			e=e+7;
		}
		cout << endl;
	
		
		cout << "Month 4: ";
		int f=e-31;
		while((f<31) && (f>0)){
		cout << f << " ";
		f=f+7;
		}
		cout << endl;

		cout << "Month 5: ";
		int g=f-30;
		while((g<32) && (g>0)){
			cout << g << " ";
			g=g+7;
		}
		cout << endl;

		cout << "Month 6: ";
		int h=g-31;
		while((h<31) && (h>0)){
			cout << h << " ";
			h=h+7;
		}
		cout << endl;

		cout << "Month 7: ";
		int k=h-30;
		while((k<32) && (k>0)){
			cout << k << " ";
			k=k+7;
		}
		cout << endl;

		cout << "Month 8: ";
		int p=k-31;
		while((p<32) && (p>0)){
				cout << p << " ";
				p=p+7;
				}
				cout << endl;

		cout << "Month 9: ";
		int o=p-31;
		while((o<31) && (o>0)){
		cout << o << " ";
		o=o+7;
		}
		cout << endl;

		cout << "Month 10: ";
		int q=o-30;
		while((q<32) && (q>0)){
			cout << q << " ";
		q=q+7;
		}
		cout << endl;

		cout << "Month 11: ";
		int r=q-31;
		while((r<31) && (r>0)){
		cout << r << " ";
		r=r+7;
		}
		cout << endl;

		cout << "Month 12: ";
		int s=r-30;
		while((s<32) && (s>0)){
		cout << s << " ";
		s=s+7;
		}
		cout << endl;		


}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{
int year;
int first;
int leap_year;
cin >> year;
cin >> first;
first=1+(7-first);
int month=1;
if(year%100==0)
{
    if(year%400==0)
    {
        leap_year=1;
    }
    else{
        leap_year=0;
    }
}
else
{
    if(year%4==0)
    {
        leap_year=1;
    }
    else
    {
        leap_year=0;
    }

}

while(month<=13)
{
    cout << "Month" << " " << month << ":" << " ";
    if(month!=2){
        if(month==8)
        {
            month=month+1;
        }
        else
        {
          month=month+0;  
        }

    if(month%2==1 )
    {
        while(first<=31)
        {
            cout << first << " " ;
            first=first+7;
        }
        first=first-31;

    }
    else
    {
        while(first<=30)
        {
            cout << first << " ";
            first=first+7;
        }
        first=first-30;

    }
    }
    else{
        if(leap_year==1)
        {
            while(first<=29)
            {
                cout << first << " ";
                first=first+7;

            }
            first=first-29;
        }
        else
        {
            while(first<=28)
            {
                cout << first << " ";
                first=first+7;

            }
            first=first-28;
        }
    }
    month=month+1;
    cout << endl;

}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include <simplecpp>
main_program{
int N,d;
cin>>N>>d;
bool leap=false;
if(N%400==0)
	leap=true;
if(N%100!=0 && N%4==0)
	leap=true;
int day=8-d;
for(int i=1;i<=12;i++)
{
	cout<<"Month "<<i<<": ";
	switch(i){
	case 1:
	case 3:
	case 5:
	case 7:
	case 8:
	case 10:
	case 12:
		while(day<32){
		cout<<day<<" ";
		day+=7;
		}
	day-=31;
	break;
	case 2:
	if(leap){
	while(day<30){
		cout<<day<<" ";
		day+=7;
		}
	day-=29;
	}
	else{
	while(day<29){
		cout<<day<<" ";
		day+=7;
		}
	day-=28;
	}
	break;
	case 4:
	case 6:
	case 9:
	case 11:
	while(day<31){
		cout<<day<<" ";
		day+=7;
		}
	day-=30;
	break;
	}
	if(day==0)
		day=7;
	cout<<endl;
}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include <simplecpp>

main_program{
	int a,b,e;
	cin>>a;
	cin>>b;
	if(a%4==0 && a%100!=0){
	int c = 7-b +1;
	int d = c+21;
	int f = c+28;
	cout<<"Month 1: "<<c<<" "<<c+7<<" "<<c+14<<" "<<d<<endl;
	 e = 31-d;
	 c = 7-e ;
	 d = c+21;
	 cout<<"Month 2: "<<c<<" "<<c+7<<" "<<c+14<<" "<<d<<endl;
	 e = 29-d;
         c = 7-e ;
         d = c+21;
         cout<<"Month 3: "<<c<<" "<<c+7<<" "<<c+14<<" "<<d<<" "<<f<<endl;


	}
	else if(a%100==0 && a%400 ==0){
for(int i=1;i<=12;i++){
cout<<"Month"<<i<<" "<<endl;
}

	}

	else{
	for(int i=1;i<=12;i++){
cout<<"Month"<<" "<<i<<":"<<endl;
}

	
	}


}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{
	int N,d;
	cin>>N>>d;
	
	int feb;

	if (N%400 == 0){
		feb = 29;
	}
	else if ((N%400 != 0) && (N%100 == 0)){
		feb = 28;
	}
	else{
		if (N%4 == 0){
			feb = 29;
		}
		else{
			feb = 28;
		}
	}
		
	int k = 8 - d;
	cout<<"Month 1: ";
	while(k<=31){
		cout<<k<<" ";
		k = k+7;
	}
	cout<<endl;
	k =k - 31;
        cout<<"Month 2: ";
        while(k<=feb){
                cout<<k<<" ";
                k = k+7;
	}
	cout<<endl;

	k =k - feb;
        cout<<"Month 3: ";
        while(k<=31){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 31;
        cout<<"Month 4: ";
        while(k<=30){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 30;
        cout<<"Month 5: ";
        while(k<=31){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 31;
        cout<<"Month 6: ";
        while(k<=30){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 30;
        cout<<"Month 7: ";
        while(k<=31){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 31;
        cout<<"Month 8: ";
        while(k<=31){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 31;
        cout<<"Month 9: ";
        while(k<=30){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 30;
        cout<<"Month 10: ";
        while(k<=31){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 31;
        cout<<"Month 11: ";
        while(k<=30){
                cout<<k<<" ";
                k = k+7;
        }
        cout<<endl;

	k =k - 30;
        cout<<"Month 12: ";
        while(k<=31){
                cout<<k<<" ";
                k = k+7;
        }
       
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include<simplecpp>
main_program{
	int year,d,x,Month;
	cin>>year;
	cin>>d;
	if(year%4!=0){
		x=8-d;
		cout<<"Month 1: ";
		while(x<=31){
			cout<<x<<" ";
			x=x+7;
		}

		cout<<"\nMonth 2: ";
		while(x>31 && x<=59){
			cout<<x-31<<" ";
		}
	}

}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include <simplecpp>
main_program
{
	int y,d,s;
	bool leap;
	cin>>y>>d;
	if(y%4==0 && y%400==0)
		leap=true;
	else
		leap=false;
	s=7-(d-1);
	cout<<"Month 1: ";
	while(s<=31)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	int r= 38-s;
	cout<<"Month 2: ";
	s=r;

	if(leap)
	{

		while(s<=29)
		{
			cout<<s<<" ";
			s=s+7;
		}
		r=36-s;
	}
	else
	{
		while(s<=28)
		{
			cout<<s<<" ";
		       s=s+7;	
		}
		r=35-s;
	}
	cout<<endl;
	cout<<"Month 3: ";
	s=7-r;
	while(s<=31)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	r=38-s;
	s=7-r;
	cout<<"Month 4: ";
	while(s<=30)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	r=37-s;
	s=7-r;
	cout<<"Month 5: ";
	while(s<=31)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	r=38-s;
	s=7-r;
	cout<<"Month 6: ";
	while(s<=30)
	{ 
		cout<<s<<" " ;
		s=s+7;
	}
	cout<<endl;
	r=37-s;
	s=7-r;
	cout<<"Month 7: ";
	while(s<=31)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	r=38-s;
	s=7-r;
	cout<<"Month 8: ";

	while(s<=31)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	r=38-s;
	s=7-r;
	cout<<"Month 9: ";
	while(s<=30)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	r=37-s;
	s=7-r;
	cout<<"Month 10: ";
	while(s<=31)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	r=38-s;
	s=7-r;
	cout<<"Month 11: ";
	while(s<=30)
	{
		cout<<s<<" ";
		s=s+7;
	}
	cout<<endl;
	r=37-s;
	s=7-r;
	cout<<"Month 12: ";
	while(s<=31)
	{
		cout<<s<<" ";
		s=s+7;
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a C++ program to take two inputs from the user, the year N, and d, the day of the week that January 1st falls on. Assume that the days are encoded as follows: (Mon: 1, Tues: 2, Wed: 3,   Sun: 7). Based on this, print all the dates on which Sunday falls on in that year.You must also take into account if the year is a leap year or not. The year is said to be a leap year if the year is divisible by four, except for end-of-century years where the year should be divisible by 400.

Example:Let s say you were interested in finding out all the dates when Sunday is going to be this year i.e. 2024, then the input to your code should be:2024 1Explanation for the above input: 2024 is the year and 1st Jan happened to be on Monday this year, hence was number-encoded as 1The output should list the dates of all Sundays in the year N, month-wise on a new line.

Constraints (Assume)1000 <= N (Year) <= 35001 <= d <= 12

Student submission:
#include <simplecpp>
main_program{
	int n,d;
	cin>>n>>d;
	int dof=28;
	int k=0;
	if (((n%4==0)&&(n%100!=0))||(n%400==0)) {dof=29;}
	cout<<"Month 1: "; for(int i=8-d;i<32;i=i+7){cout<<i<<" "; k=i;} 
	cout<<endl;
	cout<<"Month 2: "; for(int i=k-24;i<(dof+1);i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 3: "; for(int i=k+7-dof;i<32;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 4: "; for(int i=k-24;i<(31);i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 5: "; for(int i=k-23;i<32;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 6: "; for(int i=k-24;i<31;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 7: "; for(int i=k-23;i<32;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 8: "; for(int i=k-24;i<32;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 9: "; for(int i=k-24;i<31;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 10: "; for(int i=k-23;i<32;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 11: "; for(int i=k-24;i<31;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
	cout<<"Month 12: "; for(int i=k-23;i<32;i=i+7) {cout<<i<<" "; k=i;}
	cout<<endl;
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A