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>
main_program{
    int a,b;
    cin>>a>>b;
    int sum=a+b;
    int p=sum/1000;
    if(p==1 || p==3||p==4){
        cout<<sum+21590000;
    }
    else if(p==5|| p==7||p==8){
        cout<<sum+25760000;
    }
    else 
    cout<<"invalid";
}

Grading criterion: Condition for 2576
Rating A: correctly checks the condition for the extension 2576
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<iostream>
using namespace std;
int main(){
    int c1,c2,sum,s,r,count=0;
    cin>>c1>>c2;
    sum = c1+c2;
    s=sum;
    while(s>0){
        r= s%10;
        count+=1;
        s = s/10;
    }
    if(r==1&& count ==4 || r==3&& count ==4 || r==4 && count ==4){
        cout<<"2159"<<sum;
    }
    else if(r==5&& count ==4 || r==7&& count ==4 || r==8 && count ==4){
        cout<<"2576"<<sum;
    }
    else {
        cout<<"invalid";
    }
    return 0;
}

Grading criterion: Condition for 2576
Rating A: correctly checks the condition for the extension 2576
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>>m>>n;
    if(m<0 || m>9999) {
        cout<<"invalid";}
        if (n<0 || n>9999) {cout<< "invalid";}
    int sum;
    sum=m+n;
    if ((sum>1000 && sum<2000)|| (sum>2999 && sum<5000)) {
        cout<<"2159"<<sum <<endl;
    }
    else if ((sum>4999 && sum<6000) || (sum>6999 && sum<9000))
     {cout << "2576"<<sum<<endl;
     return 0;
     }
    else cout << "invalid" << endl;
    }

Grading criterion: Condition for 2576
Rating A: correctly checks the condition for the extension 2576
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 inp1, inp2;
    int dialednum;
    cin>>inp1>>inp2;
    dialednum=inp1+inp2;

    if (dialednum/1000==1 || dialednum/1000==3 || dialednum/1000==4){
        cout<<"2159"<<dialednum<<endl;
        
    } 
    else if (dialednum/1000==5 || dialednum/1000==7 || dialednum/1000==8){

        cout<<"2576"<<dialednum<<endl;
    }
    else{
        cout<<"invalid"<<endl;
    }
    


}

Grading criterion: Condition for 2576
Rating A: correctly checks the condition for the extension 2576
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>>m;
    cin>>n;
    int sum,mod;
    sum=m+n;
    mod=sum/1000;
    if(mod==1 || mod==3 || mod==4){
        cout<<"2159"<<sum;
    }
    else if(mod==5 || mod==7 || mod==8){
        cout<<"2576"<<sum;
    }
    else{
        cout<<"invalid";
    }
    
}

Grading criterion: Condition for 2576
Rating A: correctly checks the condition for the extension 2576
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;
    cout<<"enter initial 4 digit numbers 1st telephone:";
    cin>>a;
    cout<<"enter initial 4 digit number 2nd telephone:";
    cin>>b;
    cout<<"updated numbers";
    cout<<a<<"2129";
    cout<<b<<"2576";


}

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 <simplecpp>

int main(){
    int m,n;
    cin>>m;
    cin>>n;
    int s=m+n;
    int firstd = (s/1000);
    if((firstd==0 )|| (firstd==2)||(firstd==6)||(firstd==9))
     {cout<<"invalid";}
    else if((firstd==1)||(firstd==3)||(firstd==4)) {
            cout<<"2159"<<s<<endl;}
      else if((firstd==5)||(firstd==7)||(firstd==8)) {
        cout<<"2576"<<s<<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 num1,num2;
        cin>>num1>>num2;
        int sum;
        sum=num1+num2;
        if(sum<1000){
            cout<<"invalid";
        }
        if(sum>=1000 && sum<2000){
            cout<<"2159"<<sum;
        }
        if(sum>=2000 && sum<3000){
            cout<<"invalid";
        }
        if(sum>=3000 && sum<4000){
            cout<<"2159"<<sum;
        }
        if(sum>=4000 && sum<5000){
            cout<<"2159"<<sum;
        }
        if(sum>=5000 && sum<6000){
            cout<<"2576"<<sum;
        }
        if(sum>=6000 && sum<7000){
            cout<<"invalid";
        }
        if(sum>=7000 && sum<8000){
            cout<<"2576"<<sum;
        }
        if(sum>=8000 && sum<9000){
            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: 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 n1,n2,sum;
    cin>>n1>>n2;
    sum=n1+n2;
    if(sum>=0 && sum<=999)
    {cout<<"invalid";}
    else if(sum>=2000 && sum<=2999)
    { cout<<"invalid";}
    else if(sum>=6000 && sum<=6999) {
        cout<<"invalid";
    }
    else if(sum>=9000) {
        cout<<"invalid";
    } 
    else if(sum>1000 && sum<=1999) 
        { cout<<"2159"<<sum;}  
        else if(sum>=3000 && sum<=4999) {cout<<"2159"<<sum;}
        else if(sum>5000 && sum<=5999) {cout<<"2576"<<sum;}
        else if(sum>=7000 && sum<=8999){cout<<"2576"<<sum;}
        
}

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 ; int n;
    cin>>m;
    cout<<" ";
    cin>>n;
    int number=m+n;
    int firstdig=number/1000;
    if(firstdig==1||firstdig==3||firstdig==4)
    cout<<"2159"<<number<<endl;
    else if(firstdig==5||firstdig==7||firstdig==8)
    cout<<"2576"<<number<<endl;
    else if (firstdig==0||firstdig==2||firstdig==6||firstdig==9)
    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<iostream>

using namespace std;

int main(){
    int a,b;
    cin>>a;
    cin>>b;
    int c = a + b;
    int k=c;
    int reverse=0;
    while(c>0){
     int lastdigit = c%10;

    reverse = 10*reverse + lastdigit;
    c/=10;
}

    int f = reverse%10;
    if ( f==1 || f==3 || f==4){
        cout<<"2159"<<k;
    }
    else if ( f==5 || f==7 || f==8){
    cout<<"2576"<<k;
    }

    else if (f==0 || f==2 || f==6 || f==9 ){

        cout<<"invalid";
    }
    return 0;
}

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 >> m >> n;
    int x;
    x=m+n;
    if(x<1000)
    cout << "Invalid";
    else{
        x=x/1000;
        if(x==1 || x==3 || x==4)
        cout << "2159" << m+n;
        else 
        if(x==5 || x==7 || x==8)
        cout << "2576" << m+n;
        else
        if(x==2 || x==6 || x==8)
        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