CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>

int main()
{
    int a, b;
    cin >> a >> b;
    int sum = a + b;
    if(sum < 1000)
    {
        cout << "invalid";
    }
    while (sum >= 10)
    {
        sum /= 10;
    }
    int last_digit = sum;
    if(last_digit == 1 || last_digit == 3 || last_digit == 4)
    {
        cout << "2159" << (a + b);
    }
    else if(last_digit == 5 || last_digit == 7 || last_digit == 8)
    {
        cout << "2576" << (a + b);
    }
    else 
    {
        cout << "invalid";
    }

}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>
main_program{
    int x,y,z,u;
    cin>>x>>y;
    z=x+y;
    u=(z/1000);
    if(u==1||u==3||u==4)
    {
        cout<<"2159"<<z;
    }
    else if(u==5||u==7||u==8)
    {
        cout<<"2576"<<z;
    }    
    else
    {
        cout<<"invalid";
    }
}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>
main_program{
    int n,a,b;
    cin>>a>>b;
    if(a>0&&b>0) {
        n=a+b;
    }
    
      if(n>=1000&&n<2000)
    cout<<21590000+n<<endl;
    if(n>=3000&&n<5000)
    cout<<21590000+n<<endl;
    if(n>=5000&&n<6000)
    cout<<25760000+n<<endl;
    if(n>=7000&&n<9000)
    cout<<25760000+n<<endl;
    else cout<<"invalid"<<endl;
    }

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: C
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
# include <iostream>
using namespace std;
 
int main(){
	int m,n,x;
	cin>>m>>n;
	x=m+n;
	if(x>=9000||x<1000)
		cout<<"invalid"<<endl;
	else if(x>=7000)
		cout<<25760000+x<<endl;
	else if(x>=5000)
		cout<<x+25760000<<endl;
	else if(x>=3000)
		cout<<x+21590000<<endl;
	else if(x>=2000)
		cout<<"invalid"<<endl;
	else cout<< x+21590000<<endl;
}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: B
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>
main_program{
    int n,m;
    cin>>n>>m;
    if(n>=0 && n<=9999 && m>=0 && m<=9999){
        int sum;
        sum =n+m;
        int d=sum; 
        if(sum>=1000 && sum<=9999){
        while(d>=10){
            d=d/10;
        }
        if(d==1 || d==3 || d==4){
            cout<<"2159"<<sum;

        }
        else if (d==5 || d==7 || d==8){
            cout<<"2576"<<sum;
        }
        else if (  d==2 || d==6 || d==9)
        cout<<"invalid";
    }
    
    else cout<<"invalid";
    }

    

}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include <simplecpp>
main_program{
    int n1,n2; cin>> n1 >>n2;
    int dialed_num = n1+ n2;
    int final_num = dialed_num; 
    int first_digit = dialed_num/1000;
    if (first_digit == 1 || first_digit == 3  || first_digit == 4)
        final_num+=2159*10000;
    else if (first_digit == 5 || first_digit == 7  || first_digit == 8)
    {
        final_num+=2576*10000;
    }
    else
    {
        cout << "invalid";
        return 0;
    }
    cout << final_num;

}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>
main_program{
    int a,b,n;
    cin >> a >> b;
    n=a+b;
        int x,y;
        x=n%1000;
        if (x==1||x==3||x==4){
          y=21590000+n;
          cout << y << endl;
        }
        else if (x==5||x==7||x==8){
            y=25760000+n;
            cout << y << endl;
        }
        else if(x==0||x==2||x==6||x==9) cout << "invalid";
    }

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>
int main(){
    int i,n1,n2,sum;
    cin>>n1>>n2;
    sum=n1+n2;
    int j;
    if(sum<10000 && sum>999){

    for(j=sum;j>0;j=j/10)
    i=j;

    if(i==1 || i==3 || i==4){
        cout<<"2159"<<sum;
    }
    else if(i==5 || i==7 || i==8){
        cout<<"2576"<<sum;
    }
    else
    cout<<"invalid";}
    else 
    cout<<"invalid";

}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>

main_program  {
    int dial1;
    int dial2;
    int dial;
    cin>>dial1;
    cin>>dial2;

dial=dial1+dial2;
if (0<=dial<1000 or 1999<dial<3000 or 5999<dial<7000 or 8999<dial<10000)
{cout<<"Invalid"};
else if (999<dial<2000 or 2999<dial<5000 )
{cout<<2159<<dial};
else if (4999<dial<6000 or 6999<dial<9000)
 {cout<<2576<<dial};
}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: B
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>
main_program{
unsigned int m,n;
cin>>m>>n;
int a=(m+n)/1000;
if(m+n>9999){
    cout<<"invalid input!";
}
else if (a==1 ){
    cout<<21590000+m+n<<endl;
}
else if(a==3){
    cout<<21590000+m+n;
}
else if(a==4){
    cout<<21590000+m+n;
}
else if(a==5){
    cout<<25760000+m+n;
}
else if(a==7){
    cout<<25760000+m+n;
}
else if (a==8){
    cout<<25760000+m+n;
}

else cout<<"invalid"<<endl;
}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>
main_program {
    int m,n;
    cin>>n>>m;
    int sum=m+n;
    if (1000<=sum && sum<=1999 || 3000<=sum && sum<=4999){
      cout<<2159<<sum;
    }
    else if (5000<=sum && sum<=5999 || 7000<=sum && sum<=8999){
      cout<<2576<<sum;
    }
    else 
       cout<<"invalid";
    
}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: college X telephone exchange office has been struggling with a problem that the phone system is getting mixed up and connecting callers to wrong numbers. The users dial a 4 digit number, and the telephone exchange needs to extend it to an 8 digit number by prefixing it with 2159 or 2576, according to certain rules (see below). However, it has been noticed that  when a user dials a 4-digit number, an old system which can handle only 8-digit numbers arbitrarily encodes it into two 4-digit numbers whose sum is the dialed number.

You’ve been appointed to create a solution that will automatically translate the two 4-digit numbers received from the system into the correct 8-digit phone number. 
Write a C++ program that accepts two non-negative integers as input from the user, adds them to get a 4-digit number xxxx (the number originally dialed), and prints out 2159xxxx or 2576xxxx, according to the following rules. Certain dialed numbers are invalid, and in those cases the output should simply say “invalid.”
first digit of the dialed number xxxx	prefix	Output
1xxx/3xxx/4xxx	2159	2159xxxx
5xxx/7xxx/8xxx	2576	2576xxxx
0xxxx/2xxx/6xxx/9xxx		invalid

Input Format Two positive integers separated by a space.

Output Format An 8-digit number, or invalid

Assumptions on Input
●	0 <= m <= 9999 (m may omit leading zeros).
●	0 <= n <= 9999 (n may omit leading zeros).
●	0 <= m + n <= 9999.

Student submission:
#include<simplecpp>
main_program {
    int a,b;
    cin>>a>>b;
    int c=a+b;
    int d=c/1000;
    if(d==1 || d==3 || d==4){
        cout<<21590000+c;
    }
    if(d==5 || d==7 || d==8){
        cout<<25760000+c;
    }
    if(d==0 || d==2 || d==6 || d==9){
        cout<<"invalid";
    }
}

Grading criterion: Condition for invalid
Rating A: correctly checks the invalid case
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A