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 ;
	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: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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 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: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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{

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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;
	cin>>N>>d;
	if(N==2029 && d==1){
		cout<<"Month 1:"<<7 <<14 <<21 <<28<<endl;
		cout<<"Month 2:"<<4 <<11 <<18 <<25<<endl;
		cout<<"Month 3:"<<4 <<11 <<18 <<25<<endl;
		cout<<"Month 4:"<<1 <<8 <<15 <<22 <<29<<endl;
		cout<<"Month 5:"<<6 <<13 <<20 <<27<<endl;
		cout<<"Month 6:"<<3 <<10 <<17 <<23<<endl;
		cout<<"Month 7:"<<1 <<8 <<15 <<22 <<29<<endl;
		cout<<"Month 8:"<<5 <<12 <<19 <<26<<endl;
		cout<<"Month 9:"<<2 <<9 <<16 <<23 <<30<<endl;
		cout<<"Month 10:"<<7 <<14 <<21 <<28<<endl;
		cout<<"Month 11:"<<4 <<11 <<18 <<25<<endl;
		cout<<"Month 12:"<<2 <<9 <<16 <<23 <<30<<endl;
	} 
}

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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, day;
	int date =1;
	
	int Mon = 1; int Tue = 2; int Wed = 3; int Thur = 4; int Fri = 5; int Sat = 6; 
	 int Sun = 7;
	
	cin >> N >> day;
	
	if( N%4 ==0 && N%400 == 0)
	{
	cout << "Month 1:";
	date = date + (7 -day);
		while(date <= 31)
		{
		cout << date<<" ";
		date = date + 7;
		}
		
		
			day = 31 - date +1;
			date =1;
		
		cout <<"Month 2:";
		date = date + (7 - day);
		while( date <= 28)
		{
		cout << date << " ";
		date = date + 7;
		}
	
		day = 28 - date + 1;
		date = 1;
		
		cout<<"Month 3:"
		date = date + (7 - day);
		while(date<=31)
		{
		cout << date << " ";
		date = date + 7;
		}
		
		
		repeat(9){
		int i =4;
		cout <<"Month" << i <<":";
		date = date + ( 7 -day);
		while(if i%2 == 0 date <= 30
		else date <=30)

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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 N,d;
	cin>>N>>d;
	int l=0;
	if (N%4==0){
		l=1;
		if (N%100==0 && N%400!=0){
			l=0;
		}
	}
	
	int s1=8-d;
	for (int i=1;i<=12;i++){
		cout<<"Month "<<i<<":";
		if (i==1 || i==3 || i==5 || i==7 || i==8 || i==10 || i==12){
			while (s1<=31){
				cout<<" "<<s1;
				s1=s1+7;
			}
			s1=s1%31;	
		}
		else if (i==4 || i==6 || i==9 || i==11){
			while (s1<=30){
				cout<<" "<<s1;
				s1=s1+7;
			}
			s1=s1%30;
		}
		else if (i==2 && l==1){
			while (s1<=29){
				cout<<" "<<s1;
				s1=s1+7;
			}
			s1=s1%29;
		}
		else{
			while (s1<=28){
				cout<<" "<<s1;
				s1=s1+7;
			}
			s1=s1%28;
		}
		cout<<endl;
			
	}
}

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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;
	cin>>y>>d;
	int feb=28;
	if(y%4==0)
	{
		feb=29;

	}
	if(y%100==0&&y%400!=0)
		feb=28;
d=d-1;
	for(int i=1;i<=12;i++)
	{
		int mo;
		if(i==1)
		mo=31;
		if(i==2)
			mo=feb;
		if(i==3)
			mo=31;
		if(i==4)
mo=30;
		if(i==5)
mo=31;
		if(i==6)
mo=30;
		if(i==7)
mo=31;
		if(i==8)
mo=31;
		if(i==9)
mo=30;
		if(i==10)
mo=31;
		if(i==11)
mo=30;
		if(i==12)
mo=31;
		cout<<"\nMonth "<<i<<": ";
		for(int j=1;j<=mo;j++)
		{
				d++;
			if(d==7)
			{d=0;	cout<<j<<" ";}

		}

	}
}

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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;
	int d;
	cin>> N >> d;
	if(N%4!=0){

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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<iostream>
int main(){
	using namespace std;
	int N , d;
	cin>>N>>d;
	if((N%4==0)&&(N%100!=0)){
		cout<<"it is leap year";
	}

	if((N%100==0)&&(N%400==0)){
		cout<<"it is leap year";
	}

	else{
		cout<<"not a leap year";
		if(d == 1){
		for(int i = 1; i<=12; i++){
			int j = 0, x = 4;
			while(x>0){
			j = j + 7;
			cout<<j<<" ";
			x--;
			}
			//cout<<"Month"<<i<<":"<<j<<" "<<"\n";
		}
		}


	}

}

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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,r;
	cin>>N;
	cin>>d;
	r=8-d;
	if(N%100==0){
		if(N%400==0){


		}
		else{

		}

	}
	else{
		if(N%4==0){
			cout<<"Month 1: "<<r<<" " <<r+7<<" "<<r+7<<" "<<r+7<<endl;
			

		}
		else{

		}
	}
}

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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<iostream>
using namespace std;
int main(){
	int y,d;
	cin>>y>>d;
	if(y%100==0)
	{
		if(y%400==0)//leap year
		{
		}
		else//not leap
		{
		}
	}
	else if(y%4==0)//leap year
	{
		if(d==1)
		{
			for(int i=1;i<=12;i++){
				int k=d+6;
				cout<<"Month"<<" "<<i<<":"<<" ";
				switch(i){
					case 1:while(k<=31){
						      cout<<k;
						     k=k+7;}
					      break; 
				        case 2:while(k<=60){
						       cout<<k-31<<" ";
						       k=k+7;}
					       break;
					case 3:while(k<=91){
						       cout<<k-60<<" ";
						       k=k+7;}
					       break;
					case 4:while(k<=121){
						       cout<<k-91<<" ";
						       k+=7;}
					       break;
					case 5:while(k<=152){
						       cout<<k-121<<" ";
						       k+=7;}
					       break;
					case 6:while(k<=182){
						       cout<<k-152<<" ";
						       k+=7;}
					       break;
					case 7:while(k<=213){
						       cout<<k-182<<" ";
						       k+=7;}
					       break;
					case 8:while(k<=244){
						       cout<<k-213<<" ";
						       k+=7;}
					       break;
					case 9:while(k<=274){
						       cout<<k-244<<" ";
						       k+=7;}
					       break;
					case 10:while(k<=305){
							cout<<k-274<<" ";
							k+=7;}
						break;
					case 11:while(k<=335){
							cout<<k-305<<" ";
							k+=7;}
						break;
					case 12:while(k<=366){
							cout<<k-335<<" ";
							k+=7;}
				
	
			}
		}
	}
	return 0;
}
	






















}

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
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 n,d;
	cin>>n>>d;
	if(n%4!=0) {
		if(d==1) 
		int a=7;
		cout<<"Month 1:"<<a;
		while(a<=31) {
			a=a+7;
			cout<<a;
		}
		int b=31-a;
		int c=7-b;
		cout<<"Month 2:"<<c;
		while(c<=28) {
			c=c+7;
			cout<<c;
		}
		int e=28-b;
		int f=7-e;
		cout<<"Month 3:"<<f;
                while(f<=31) {
                        f=f+7;
                        cout<<f;
                }
		int  
	
	}}

Grading criterion: Sunday Date Calculation (ASSUMING Leap year calculation is correct)
Rating A: Code correct for Leap and Non leap yeat
Rating B: Code almost correct for Leap and Non leap year, some small mistake
Rating C: Code mostly incorrect,some attempt made in the right direction
Rating D: No code or completely wrong code
Assigned grade: D