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,s=0;
while(1000<=N<=3500 && 1<=d<=12){
if(N%4==0 || N%400==0){
s=s+7;
cout<<"Month 1"<<":"<<s;
break;
}
;
if(d>=31){
continue;
}
}}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 0)
Assigned grade: D
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;
	int d;
	cin >> N >> d:
	int t =8 - d;
	int i=1;
	while(true){ 
		if (N< 1000 || N>3500 || d<1 || d > 12){
			break;
		}
		else if(N%4 == 0 && N%400 != 0){
			cout << "Month 1: ";
			while(t<=31){
				cout<< t<< " ";
				t=t+7;
			}
			t = 31 - t;
			t = 7-t;
			cout << "Month 2: ";
			while(t<=29){
				cout << t<< " ";
			}
			t = 29 - t;
			t = 7 - t;
			cout << "Month 3: ";
			while(t<=31){
				cout << t << " ";
				t=t+7;
			}
			t =31-t;
			t = 7-t;
			cout << "Month 4: ";
			while(t<=30){
				cout<<t<<" ";
				t=t+7;
			}
			t =30 - t;
			t=t-7;
			cout << "Month 5: ";
			while(t<=31){
				cout<<t<<" ";
				t = t+7;
			}
			t = 31-t;
			t = t-7;
			cout<<"Month 6: ";
			while(t<=30){
				cout << t<< " ";
				t=t+7;
			}
			t = 30-t;
			t= t-7;
			cout<< "Month 7: ";
			while(t<=31){
				cout<<t<<" ";
				t=t+7;
			}
			t=31-t;
			t = 7-t;
			cout << "Month 8: ";
			while(t<=31){
				cout<<t<<" ";
				t=t+7;
			}
			t=31-t;
			t=7-t;
			cout << "Month 9: ";
			while(t<=30){
				cout<<t<<" ";
				t=t+7;
			}
			t = 30 - t;
			t=7-t;
			cout<<"Month 10: ";
			while(t<=31){
				cout <<t<<" ";
				t=t+7;
			}
			t=31-t;
			t = 7-t;
			cout<<"Month 11: ";
			while(t<=30){
					cout<<t<<" ";
					t=t+7;
			}
			t=30-t;
			t=7-t;
			cout<<"Month 12: ";
			while(t<=31){
				t=t+7;
			}
			break;

		}
		else if(N%4 !=0){
			continue;
		}
		else if(N%400 == 0){
			continue;
		}
	}
}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 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 e,q,N,d,r,x,a,b,c,i,t,p,leapyr;
	cin>>N>>d;
	leapyr=0;
	if(N%100==0) {
		if(N%400==0) { 
			leapyr=N;
			}
		else {
			leapyr=0;
			}
		      }
	else if(N%4==0) {
		leapyr=N;
			}
	else{
	leapyr=0;
	    }
        
         p=7-d+1;
	 a=((31-p)%7)+1;
	 cout<<"Month 1: ";
         repeat(a){
		 cout<<p<<" ";
		 p=p+7; 
	 }
	 cout<<endl<<"Month 2: ";
	 q=7+p-31;
	  b=((29-q)%7)+1;
	  c=((28-q)%7)+1;
	 if(leapyr==N) { 
		 repeat(b) {
			 cout<<q<<" ";
			 q=q+7;}
		x=q;
		e=7+x-29;
                int o= ((31-e)%7)+1;
                cout<<endl<<"Month 3: ";
                repeat(o) {
                        cout<<e<<" ";
                        e=e+7;} 
		int f=7+e-31;
		int g=((30-e)%7)+1;
		cout<<endl<<"Month 4: ";

                 repeat(g) {
                         cout<<f<<" ";
                        f=f+7;}
	 }

         q=7+p-31;
	 else if (leapyr==0) {
		 repeat (c) { 
			 cout<<q<<" ";
			 q=q+7;}
		int y=q;
		e=7+x-28;
                int o= ((31-e)%7)+1;
                cout<<endl<<"Month 3: ";
                repeat(e) {
                        cout<<e<<" ";
                        e=e+7;
		}
		e=7+x-29;
                int o= ((31-e)%7)+1;
                cout<<endl<<"Month 3: ";
                repeat(e) {
                        cout<<e<<" ";
                        e=e+7;0
		}
		cout<<endl<<"Month 4: ";

		 int f=7+e-31;
		 int g=((30-e)%7)+1;
		 repeat(g) {
			 cout<<f<<" ";
                        f=f+7;

	 }


	       	
		

		
	 }
	 }

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 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 y,d,i;
	cin>>y>>d;
	i=8-d;
	int date=0;
	if(y%4!=0)
	{	
		date=date+31;
		if(date<=31)
		{
			cout<<"Month 1:";
		while(i<=31)
		{
			cout<<i<<" ";
			i=i+7;
		}
		cout<<endl;
		}
		date=date+28;
		if(date>31 && date<60)
		{
		 cout<<"Month 2:";
		 i=32%7;
		 while(i<=29)
		 {
			 cout<<i<<" ";
			 i=i+7;
		 }
		 cout<<endl;
		}
		date=date+30;
		if(date>59 && date<90)
		{
			cout<<"Month 3:";
		i=60%7;
		while(i<31)
		{
			cout<<i<<" ";
			i=i+7;
		}
		cout<<endl;
		}
		date=date+31;
		if(date>90 && date<122)
		{
			cout<<"Month 4:";
		i=92%7;
		while(i<30)
		{
			cout<<i<<" ";
			i=i+7;
		}
		}
		cout<<endl;
		date=date+30;
		i=123%7;
		if(date>122 && date<153)
		{
		cout<<"Month 5:";
		while(i<30)
		{
			cout<<i<<" ";
			i=i+7;
		}
		cout<<endl;
		}
		
		
	}
}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 0)
Assigned grade: C
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,jan,n;
cin>>year>>jan;
cout<<"Month 1: ";
n=8-jan;
while(n<=31){
	cout<<n<<" ";
	n=n+7;
	}
n=n-31;
cout<<endl<<"Month 2: ";
if(year%4 !=0){
	while(n<=28){
		cout<<n<<" ";
		n=n+7;
		}
		n=n-28;
		}
else if (year%10!=0 || year%100!=0){
	while(n<=29){
		cout<<n<<" ";
		n=n+7;
		}
		n=n-29;
		}
	
else if (year%10==0 && year%100==0){
	if (year%400!=0){
		while(n<=28){
		cout<<n<<" ";
		n=n+7;
		}
		n=n-28;
		}
	else {
		while(n<=29){
		cout<<n<<" ";
		n=n+7;
		}
		n=n-29;
		}
		}
cout<<endl<<"Month 3: ";
while(n<=31){
	cout<<n<<" ";
	n=n+7;
	}
n=n-31;
cout<<endl<<"Month 4: ";
while(n<=30){
	cout<<n<<" ";
	n=n+7;
	}
n=n-30;
cout<<endl<<"Month 5: ";
while(n<=31){
	cout<<n<<" ";
	n=n+7;
	}
n=n-31;
cout<<endl<<"Month 6: ";
while(n<=30){
	cout<<n<<" ";
	n=n+7;
	}
n=n-30;
cout<<endl<<"Month 7: ";
while(n<=31){
	cout<<n<<" ";
	n=n+7;
	}
n=n-31;
cout<<endl<<"Month 8: ";
while(n<=31){
	cout<<n<<" ";
	n=n+7;
	}
n=n-31;
cout<<endl<<"Month 9: ";
while(n<=30){
	cout<<n<<" ";
	n=n+7;
	}
n=n-30;
cout<<endl<<"Month 10: ";
while(n<=31){
	cout<<n<<" ";
	n=n+7;
	}
n=n-31;
cout<<endl<<"Month 11: ";
while(n<=30){
	cout<<n<<" ";
	n=n+7;
	}
n=n-30;
cout<<endl<<"Month 12: ";
while(n<=31){
	cout<<n<<" ";
	n=n+7;
	}
}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 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,i,leapYear;
	cin >> year;
	cin >> i;
	int month=1;
	i = i + (7-i);
	if(year % 100 == 0){
		if(year % 400 == 0){
			leapYear=1;
		}
			else{
				leapYear=0;
			}
		}
			else{
				if(year % 4 == 0){
					leapYear=1;
				}
					else{
						leapYear=0;
					}
				}

	while(month <= 12){
		cout << "Month" << " " << month << ":" << " ";
		if(month != 2){
			if(month %2 ==1){
				while(i <=31){
					cout << i << " ";
					i = i +7;
				}
				i = i - 31;
			}
			else{
				while(i <= 30){
					cout << i << " ";
                                        i = i + 7;
                                }
                                i = i - 30;
			
			}
		}
			else{
				if(leapYear==1){
					while(i <= 29){
                                        cout << i << " ";
                                        i = i + 7;
                                }
                                i = i - 29;
				}
				else{
					while(i <= 28){
                                        cout << i << " ";
                                        i = i + 7;
                                }
                                i = i - 28;
                                }
			}
		month = month + 1;
		cout << endl;
	}
	
	}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 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{
    
}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 0)
Assigned grade: D
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, i=1, r;
		cin>>N>>d;
		if (N%100==0){if(N%400==0){r=29;}
				else r=28;}
		else if (N%4==0){r=29;}
			else r=28;
		cout<<"Month 1: ";
		for(d; i<=31; i++, d++){
			if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 2: ";
                for(d=d, i=1; i<=r; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
             	 cout<<endl;
		 cout<<"Month 3: ";
                for(d=d, i=1; i<=31; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 4: ";
                for(d=d, i=1; i<=30; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 5: ";
                for(d=d, i=1; i<=31; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 6: ";
                for(d=d, i=1; i<=30; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 7: ";
                for(d=d, i=1; i<=31; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 8: ";
                for(d=d, i=1; i<=31; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 9: ";
                for(d=d, i=1; i<=30; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 10: ";
                for(d=d, i=1; i<=31; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 11: ";
                for(d=d, i=1; i<=30; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}
		cout<<endl;
		cout<<"Month 12: ";
                for(d=d, i=1; i<=31; i++, d++){
                        if (d%7==0){cout<<i<<" "; d=0;}}}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 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 ;
	cin>>N;
	int d ;
	cin>>d ; 
	
	
		cout<<"Month 1: ";
		int p = 8 - d ; 
		while(p<=31){
			cout<<p<<" ";
			p=p+7;
		}
		int k = p-7;
		int s = (31-k);
		cout<<endl<<"Month 2: ";
		int m = 7-s;
		int a , b, c;
		if( (((N%4)==0) &&( (N%100)!=0))|| (N%1000 ==0)){
			while(m<=29){
			cout<<m<<" ";
			m=m+7;
			}
			a = m-7;
			b= 29 - a;
		}

		
			
		if( (N%4 !=0)||((((N%4)==0)&&( (N%100)==0))&&(N%1000 !=0)))
		{
			while(m<=28){
			cout<<m<<" ";
			m=m+7;}

			a = m-7;
			b=28-a;
		}

		
		
		cout<<endl<<"Month 3: ";
		c = 7 -b ;
		while(c<=31){
			cout<<c<<" ";
			c=c+7;
		}
		a = c - 7 ;
		b = (31 - a);
		cout<<endl<<"Month 4: " ; 
		c = 7 - b ;
		while(c<=30){
			cout<<c<<" ";
			c = c+7;
		}
		a = c-7 ;
		b = (30 -a);
		cout<<endl<<"Month 5: ";
		c = 7-b;
		while(c<=31){
			cout<<c<<" ";
			c=c+7;
		}
		a = c-7;
		b=31-a;
		cout<<endl<<"Month 6: ";
		c=7-b;
		while(c<=30){
			cout<<c<<" ";
			c=c+7;
		}
		a=c-7;
		b=30-a;
		cout<<endl<<"Month 7: ";
		c=7-b;
		while(c<=31){
			cout<<c<<" ";
			c=c+7;
		}
		a=c-7;
		b=31-a;
		cout<<endl<<"Month 8: ";
		c=7-b;
		while(c<=31){
			cout<<c<<" ";
			c=c+7;
		}
		a=c-7;
		b=31-a;
		cout<<endl<<"Month 9: ";
		c=7-b;
		while(c<=30){
			cout<<c<<" ";
			c=c+7;
		}
		a=c-7;
		b=30-a;
		cout<<endl<<"Month 10: ";
			c=7-b;
		while(c<=31){
			cout<<c<<" ";
			c=c+7;
		}
		a=c-7;
		b=31-a;
		cout<<endl<<"Month 11: ";
		c=7-b;
		while(c<=30){
			cout<<c<<" ";
			c=c+7;
		}
		a=c-7;
		b=30-a;
		cout<<endl<<"Month 12: ";
		c=7-b;
		while(c<=31){
			cout<<c<<" ";
			c=c+7;
		}





}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 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 ly;
	
	for(int i=1;i<=12;i++){
		cout<<"Month"<<i<<":";
		int j=7-d+1;
		if(i==2){
			if(N%100==0){
				if(N%400==0){
					ly=true;
				}
			}
			else if(N%4==0){
				ly=true;
			}
			else{
				ly=false;
			}
			if(ly==true){
		                while(j<=29){

				        cout<<j<<" ";
				        j=j+7;
				}
			}
			else{
				while(j<=28){
					cout<<j<<" ";
					j=j+7;
				}
			}
		}
		else if(i==1||i==3||i==5||i==7||i==8||i==10||i==12){
			while(j<=31){
				cout<<j<<" ";
				j=j+7;
			}
		}
		else{
			while(j<=30){
				cout<<j<<" ";
				j=j+7;
			}
		}
		cout<<"\n";
	}
}

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 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{

Grading criterion: Leap Year Calculation
Rating A: All years correct (incl. Year % 400 = 0)
Rating B: Centuary Leap Year Correct (Year % 100 = 0 but Year % 400 != 0)
Rating C: Normal Leap Year correct (Year % 4 = 0 but Year % 100 != 0)
Rating D: Non-Leap Year also wrong (Year % 4 != 0)
Assigned grade: D