CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>
main_program{
char F,B,M;
char a,b;
int c;
cin >> a >> b >> c;
if (a=='F' && b=='B' ) {cout << "H1";}
 else if (a=='F' && b=='M'  ) {cout << "H2";}
 else if (a=='M' && b=='B' &&  c==1 ) {cout << "H3";}
 else if (a=='M'&& b=='B' &&  c==2) {cout << "H3";}
else if (a=='M' && b=='B' && c==3 ) {cout << "H4";}
else if (a=='M' && b=='B' && c==4) {cout << "H4";}
 else if (a=='M' && b=='M' && c==1 ) {cout << "H5";}
 else if (a=='M' && b=='M' && c==2) {cout << "H5";}
 else if (a=='M' && b=='M' && c==3) {cout << "H5";}}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>
main_program
{char gender,programme;
int courseyear;
cin>>gender>>programme>>courseyear;
if(gender=='F')
{if(programme=='B')
   {cout<<"H1";}
   else{cout<<"H2";}}
   else if(gender=='M')
   {if(programme=='B'){
    if(courseyear==1 || courseyear==2)
    {cout<<"H3";}
    else{cout<<"H4";}
   }
   else{cout<<"H5";}}}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>
main_program{
    char g,c,y;
    cin>>g>>c>>y;
    if(g=='F'){
        if(c=='B'){cout<<"H1";}
        else{cout<<"H2";}
    }
    else{
        if(c=='B'){
            if(y=='1' || y=='2'){cout<<"H3";}
            else{cout<<"H4";}
        }
        else{cout<<"H5";}
    }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>
main_program{
    char g,p;
    int y;
    cin>>g>>p>>y;
    if(g=='F'){if(p=='B'){cout<<"H1";}
    else if(p=='M'){cout<<"H2";}}
    else if(g=='M'){
        if(p=='B'){if (y==1||y==2){cout<<"H3";}
        if(y==3||y==4){cout<<"H4";}}
        else if(p=='M'){cout<<"H5";}
    }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>
main_program{
    char c1,c2;
    int n;
    cin>>c1>>c2>>n;
    if(c1=='F')
    {
        if(c2=='B')
        cout<<"H1";
        else
        cout<<"H2";
    }
    else
    {
        if(c2=='B')
        {
            if(n<=2)
            cout<<"H3";
            else
            cout<<"H4";
        }
        else
        cout<<"H5";
    }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>
main_program{
    char gen,pro;
    int year;
    cin>>gen>>pro>>year;
    if(gen=='F'){
        if(pro=='B')cout<<"H1";
        else cout<<"H2";
    }
    else {
        if(pro=='B'){
            if(year==1 || year==2)cout<<"H3";
            else cout<<"H4";
        }
        else cout<<"H5";
    };
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>
int main(){
    char gender,course;
    int year;
    cin>>gender>>course>>year;
    if(gender=='F'){
        (course=='B')?cout<<"H1":cout<<"H2";
    }
    else{
        if(course=='B'){
            ((year==1)||(year==2))?cout<<"H3":cout<<"H4";    
        }
        else cout<<"H5";
    }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>

main_program {
        char gender, programme;
        int year;
        cin >> gender >> programme >> year;
        if (gender == 'F') {
                if (programme == 'B' && year > 0 && year < 5) cout << "H1";
                if (programme == 'M' && year > 0 && year < 4) cout << "H2";
        }
        if (gender == 'M') {
                if (programme == 'B') {
                        if (year == 1 || year == 2) cout << "H3";
                        if (year == 3 || year == 4) cout << "H4";
                }
                if (programme == 'M' && year > 0 && year < 4) cout << "H5";
        }
        cout << endl;
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include<simplecpp>
int main() {
    char c1,c2;int n;
    cin>>c1>>c2>>n;
     if (c1=='M') { if(c2=='B') {
        if(n==1|| n==2) {
            cout<<"H3";
                    }
  else cout<<"H4";     }
 else cout<<"H5";
     } else {
        if(c2=='B') {
            cout<<"H1";
        } else cout<<"H2";
     }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: In the college X hostel allocation system, students are assigned hostels based on their roll number, course year, programme, gender, etc.. In this problem, you shall implement a set of (imaginary) rules. We will pretend that there are only five hostels, numbered from h1 to h5, two genders, male and female, programme (bachelor’s and master’s), and year. Go through the hostel allocation rules given below:

Programme Details
- Bachelor's courses are for 4 years.
- Master's courses are for 3 years.

Hostel Allocation Rules:
1. If a candidate is female:
●	For Bachelor's any year, she will be allocated to H1.
●	For Master's any year, she will be allocated to H2.
2. If a candidate is male::
●	For Bachelor's 1st or 2nd year, he will be allocated to H3
●	For Bachelor's 3rd or 4th year: he will be allocated to H4
●	For Master's any year, he will be allocated to H5.

Input Format:
- A single line of input consisting of:
●	Gender as a single letter (F or M)
●	Programme (B or M) 
●	Course year. If the input to programme was B, then assume that the input for course year will be between 1 and 4, both inclusive, else the input will be between 1 and 3, both inclusive.

Output Format The allocated hostel. example: H1, H2, H3 etc.

Assumptions on Input The input values will always be valid

Student submission:
#include <simplecpp>

main_program{
        char g,p; int y;
        cin >> g>>p>>y;
        if ( g=='F'){
                cout << (p=='B' ? "H1":"H2");
        }
        else if (g=='M'){
                if (p=='B'){
                        cout <<( y<3 ? "H3":"H4");
                }
                else
                        cout << "H5";
        }
}

Grading criterion: Output
Rating A: correctly prints the output
Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;


int main(){
    int n;
    int x;
    int a[n];

    cin>>n;
    for(int i=0; i<=n; i++)
    {
        cin>>a[i];

    }
    int i;
    for(i=n;a[i]<n;--i)
    {
        cout<<a[n];

    }
    cin>>x;

    int sum;
    for(int j=0;j<n; j++)
    {
        if(x>a[j])
        sum=sum+a[j];
    }
    cout<<sum;

    return 0;
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
using namespace std;

int main(){
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    int X;
    int sum;
    cin>>X;
    for(int i=n-1;i>=0;i--){
        cout<<arr[i]<<" ";
    }
    for(int i=0;i<n;i++){
        if(arr[i]>X){
            sum=sum+arr[i];
        }
    }
    cout<<'\n';
    cout<<sum<<endl;
}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
 using namespace std;
 int main() {
    int n; 
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++) {
        cin>>arr[i];
    } 
    for(int i=0;i<n/2;i++) {
       
       swap(arr[i],arr[n-i-1]);
    }
    for(int i=0;i<n;i++) {
        cout<<arr[i]<<" ";
    } 
    cout<<endl;
    int X;
    cin>>X;
    int sum=0;
    for(int i=0;i<n;i++) {
        cin>>arr[i];
        if (arr[i]>X) {
        sum+=arr[i];
        }
    } 
    cout<<sum;

}

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A
Problem: Write a C++ program that performs the following operations:
1. Input:
   Accept an integer 'n' representing the size of an array.
   Accept 'n' integer elements and store them in the array.
   Accept another integer 'x'.

2. Reverse Printing:
   Print the array elements in reverse order separated by spaces

3. Sum Calculation:
   Calculate and display the sum of all elements greater than 'x'

### Input Format
n
A1 A2 A3 ... An
x

### Output Format
First line: elements of the array in reverse order
Second line: sum of all elements greater than 'x'

### Constraints
'1 ≤ n ≤ 1000'
'-10^6 ≤ A[i], x ≤ 10^6'

Student submission:
#include<iostream>
#include<cmath>
using namespace std;

int main(){
    int N;
    cin>>N;
    int arr[N];
    for(int i=0;i<N;i++){
        cin>>arr[i];
    }
    int X;
    cin>>X;
    int sum=0;
      for(int j=0;j<N;j++){
        if(arr[j]>X){
            sum=sum+arr[j];
        }
      }
      for(int i=0;i<N;i++){
        cout<<arr[(N-1)-i]<<" ";
      }
    cout<<endl;

            
            
        
        cout<<sum;
    

    }

Grading criterion: Declaration of variables and array
Rating A: correctly declares the two variables n, x, and array/vector

Rating B: Some issue
Rating C: Major issue
Rating D: 0
Assigned grade: A