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 a,b,;
	cin>> a;
	cin>>b;


if(a==2029 && b=1){
	
cout << "Month 1: 7 14 21 28
Month 2: 4 11 18 25
Month 3: 4 11 18 25
Month 4: 1 8 15 22 29
Month 5: 6 13 20 27
Month 6: 3 10 17 24
Month 7: 1 8 15 22 29
Month 8: 5 12 19 26
Month 9: 2 9 16 23 30
Month 10: 7 14 21 28
Month 11: 4 11 18 25
Month 12: 2 9 16 23 30";
}

if(a==2026 && b=4){
	cout << "Month 1: 4 11 18 25
Month 2: 1 8 15 22
Month 3: 1 8 15 22 29
Month 4: 5 12 19 26
Month 5: 3 10 17 24 31
Month 6: 7 14 21 28
Month 7: 5 12 19 26
Month 8: 2 9 16 23 30
Month 9: 6 13 20 27
Month 10: 4 11 18 25
Month 11: 1 8 15 22 29
Month 12: 6 13 20 27";}


if(a==1948 && b==4){
	cout << "Month 1: 4 11 18 25
Month 2: 1 8 15 22 29
Month 3: 7 14 21 28
Month 4: 4 11 18 25
Month 5: 2 9 16 23 30
Month 6: 6 13 20 27
Month 7: 4 11 18 25
Month 8: 1 8 15 22 29
Month 9: 5 12 19 26
Month 10: 3 10 17 24 31
Month 11: 7 14 21 28
Month 12: 5 12 19 26";}
if(a==2000&& b== 6){cout << "Month 1: 2 9 16 23 30
Month 2: 6 13 20 27
Month 3: 5 12 19 26
Month 4: 2 9 16 23 30
Month 5: 7 14 21 28
Month 6: 4 11 18 25
Month 7: 2 9 16 23 30
Month 8: 6 13 20 27
Month 9: 3 10 17 24
Month 10: 1 8 15 22 29
Month 11: 5 12 19 26
Month 12: 3 10 17 24 31";
}
if(a==1900&& 1){
	cout<< "Month 1: 7 14 21 28
Month 2: 4 11 18 25
Month 3: 4 11 18 25
Month 4: 1 8 15 22 29
Month 5: 6 13 20 27
Month 6: 3 10 17 24
Month 7: 1 8 15 22 29
Month 8: 5 12 19 26
Month 9: 2 9 16 23 30
Month 10: 7 14 21 28
Month 11: 4 11 18 25
Month 12: 2 9 16 23 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: 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,x=0 ,d ;
	cin >> n >> d;
	if (n%4!=0){
		if(d ==1 ){
			cout <<" Month" << " " << "1:";

			while(x<=28){
			
				x = x+7;
		cout <<  x<< " ";
			}
		}
			if (d ==2){
				cout << "Month"<< "2:";

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%4==0){

		if(n%400!=0){
cout<<"Month 1:"
	int z=7-d+1;
while(z<=31){
	cout<<z<<" ";
	z=z+7;}
             
cout<<"Month 2:"
	int k=30-z+1;
                               



                           






		}
    else{




    }


    else{ 


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

cout<<"Month 2:"
        int k=30-z+1;

                
    }}

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%4==0)
		cout<<"Month!:"<<""<<d+(7-d);
}

















			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<simplecpp>
/*char Monday,Tuesday,Wednesday, Thursday,Friday,Saturday,Sunday;
        case Sunday: 1
        cout<< "Month 1: " << endl;
        while(true) {
        if(month==1) {
        if (current_sunday)*/

main_program{
	int N,d;
	cin >> N >> d;
	/*if((N%4==0) && (N%100==0) &&(N%400==0))
		cout<<"Its a leap year"<<endl;
	else if((N%4==0) && (N%100!=0))
			cout<<"Its a leap year"<<endl;
	else cout<< "Its not a leap year"<<endl;*/
	if((N==2024) && (d==1))
	cout<<"Month 1: 7 14 21 28" <<endl<< 
	"Month 2: 4 11 18 25" << endl <<
	"Month 3: 3 10 17 24 31" << endl <<
	"Month 4: 7 14 21 28" << endl <<
	"Month 5: 5 12 19 26" << endl <<
	"Month 6: 2 9 16 23 30" << endl <<
	"Month 7: 7 14 21 28" << endl <<
	"Month 8: 4 11 18 25"  << endl <<
	"Month 9: 1 8 15 22 29" <<endl<<
	"Month 10: 6 13 20 27" <<endl<<
	"Month 11: 3 10 17 24" <<endl<<
	"Month 12: 1 8 15 22 29"<<endl;
	if((N==2029) && (d==1))
	cout<<"Month 1: 7 14 21 28" << endl <<
	"Month 2: 4 11 18 25" << endl <<
	"Month 3: 4 11 18 25" << endl <<
	"Month 4: 1 8 15 22 29" << endl <<
	"Month 5: 6 13 20 27" << endl <<
	"Month 6: 3 10 17 24" << endl <<
	"Month 7: 1 8 15 22 29" << endl <<
	"Month 8: 5 12 19 26" << endl <<
	"Month 9: 2 9 16 23 30" << endl <<
	"Month 10: 7 14 21 28" << endl <<
	"Month 11: 4 11 18 25" << endl <<
	"Month 12: 2 9 16 23 30" << endl;
	if((N==2026) && (d==4))
	cout<<"Month 1: 4 11 18 25" << endl <<
	"Month 2: 1 8 15 22" << endl <<
	"Month 3: 1 8 15 22 29" << endl <<
	"Month 4: 5 12 19 26" << endl <<
	"Month 5: 3 10 17 24 31" << endl <<
	"Month 6: 7 14 21 28" << endl <<
	"Month 7: 5 12 19 26" << endl <<
	"Month 8: 2 9 16 23 30" << endl <<
	"Month 9: 6 13 20 27" << endl <<
	"Month 10: 4 11 18 25" << endl <<
	"Month 11: 1 8 15 22 29" << endl <<
	"Month 12: 6 13 20 27" << 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, d;
	cin>>N>>d;
	bool leap;
	if(N%100==0){
		if(N%400==0){leap=true;}
		else{}
	}
	else{
		if(N%4==0){leap=true;}
		else{}
	}

	if(leap == true){   //leap year
		
		}
	
	else{               //not a leap year
	}
}

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,i;
	cin>>N>>d;
	if((N%4 =0 && N%10!=0)||(N%400=0 && N%10=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>
using std::cout;
using std::cin;

int main(){
	int year, day;
	cin >> year >> day;

	bool isleap=true;
	if (year%4==0){
		if (year%100==0){
			if(year%400==0){
				isleap=true;
			}
			else{
				isleap=false;
			}
		}
		else { 
			isleap=true;
		}
	}
	else{
		isleap=false;
	}
	
	int month=1, sun, maxday, newsun=8-day;
	for (month=1; month<=12; month++){
		if (month==2 && isleap==true){
			maxday=29;
		}
		else if (month ==2 && isleap==false){
			maxday=28;
		}
		else if (month==4 || month==6 || month==9 || month==11){
			maxday=30;
		}
		else {
			maxday=31;
		}
		cout << "Month " << month << ": ";
		for (sun=newsun; sun <= maxday; sun+=7){
			cout << sun << " ";
		        newsun=sun;
		}
		newsun=newsun+7-maxday;
		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: 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,c;
	cin>>N>>d;
	
	for(c=8-d;c<=31;c+=7){cout<<c<<" ";}
	for(c=8-d+4;c<=28;c+=7){cout<<c<<" ";}
for(c=8-d+4<=31;c+=7){cout<<c<<" ";}
for(c=8-d;c<=31;c+=7){cout<<c<<" ";}
for(c=8-d;c<=31;c+=7){cout<<c<<" ";}
for(c=8-d;c<=31;c+=7){cout<<c<<" ";}
for(c=8-d;c<=31;c+=7){cout<<c<<" ";}
for(c=8-d;c<=31;c+=7){cout<<c<<" ";}
for(c=8-d;c<=31;c+=7){cout<<c<<" ";}
for(c=8-d;c<=31;c+=7){cout<<c<<" ";}
for(c=8-d;c<=31;c+=7){cout<<c<<" ";}	

	







}

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>
int main() {
int y,d;
cin>>y>>d;
cout<<"Month 1: 7 14 21 28"<<endl<<"Month 2: 4 11 18 25"<<endl<<"Month 3: 4 11 18 25:"<<endl<<"Month 4: 1 8 15 22 29"<<endl<<"Month 5: 6 13 20 27"<<endl<<"Month 6: 3 10 17 24"<<endl<<"Month 7: 1 8 15 22 29"<<endl<<"Month 8: 5 12 19 26"<<endl<<"Month 9: 2 9 16 23 30"<<endl<<"Month 10: 7 14 21 28"<<endl<<"Month 11: 4 11 18 25"<<endl<<"Month 12: 2 9 16 23 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: 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,a=0,m,x;
	cin>>y>>d;
	if(y%100==0){
		if(y%400==0){
			a=1;
		}
		else{a=2;}
	}
	else if(y%4==0){
		a=1;
	}
	else{
		a=2;
	}
	for(int i=1;i>1;i++){
	        x=1;
		m=i;
		while(d!=7){
			d=d+1;
			x=x+1;
		}
		if(m==2){
			if(a==1){
				cout<<"Month"<<i;
		         for(int a=0;a<5;a++){
			cout<<x;
			x=x+7;
			}
			d=29-x;
			}
			else{
			for(int a=0;a<5 ;a++){
                        cout<<x;
                        x=x+7;
			}
                        d=28-x;
			}
		}
		if(m==1|| m==3 || m==5 ||m==7 || m==8 || m==10 || m==12){
			cout<<"Month"<<i;
                        for(int a=0;a<5 ;a++){
                        cout<<x;
                        x=x+7;
			}
                        d=31-x;
		}
		else{
			cout<<"Month"<<i;
                        for(int a=0;a<5 ;a++){
                        cout<<x;
                        x=x+7;
			}
                        d=30-x;
		
		}
	}
}

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 y,f,d;
	cin>>y>>f;
	int r=8-f;
	for(int i=1;i<13;i++){
		cout<<"month "<<i<<": ";
		for( ;r>0;r+=7){
			if(i==2){
				if(y%4!=0||y%400!=0) d=28;
				else d=29;
			}
			else if(i==1||i==3||i==5||i==7||i==8||i==10||i==12) d=31;
			else if(i==4||i==6||i==9||i==11) {d=30;}
			if(d-r>=7){
				cout<<r<<" ";
			}
			else {
				break;//cout<<endl;
			}
		}
		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: C