CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include <simplecpp>
main_program  {
    char p;
    char s;
    char r;
    char c1;// choice of player1
    char c2;// choice of player2
    
    cin >> c1;
    cin >> c2;
    
    if(c1==p && c2==r || c1==r && c2==s || c1==s && c2==p )
    {
        cout << "1";
    }
    else if(c1==r && c2==p || c1==s && c2==r || c1==p && c2==s)
    {
        cout<< "2";
    }
    else if( c1==p && c2==p || c1==r && c2==r || c1==s && c2==s)
    {
        cout << "T";// t for tie
    }
    else {
    cout <<"invalid input";}
  
    
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{
    char a, b ;
    cin >> a >> b ;
    if (a == 'r' && b == 'p')
    cout<<"2";
    else if (a == 'p' && b == 'r')
    cout<<"1";
    else if (a == 'r' && b == 's')
    cout<<"1";
    else if (a == 's' && b == 'r')
    cout<<"2";
    else if (a == 's' && b == 'p')
    cout<<"1";
    else if (a == 'p' && b == 's')
    cout<<"2";
    else if (a == 'p' && b == 'p')
    cout<<"T";
    else if (a == 'r' && b == 'r')
    cout<<"T";
    else if (a == 's' && b == 's')
    cout<<"T";
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program
{
    char c1,c2;
    cin>>c1>>c2;

    
    if((c1=='r' || c1=='s') && (c2=='r' || c2=='s'))
    {
        if(c1==c2)
        {
            cout<<'T'<<endl;
            return 0;
        }
        int z= ( c1=='r' ? 1:2 );
        cout<<z<<endl;
    } 

    if((c1=='s' || c1=='p') && (c2=='s' || c2=='p'))
    {
        if(c1==c2)
        {
            cout<<'T'<<endl;
            return 0;
        }
        int z= ( c1=='s' ? 1:2 );
        cout<<z<<endl;
    } 
    if((c1=='p' || c1=='r') && (c2=='p' || c2=='r'))
    {
        if(c1==c2)
        {
            cout<<'T'<<endl;
            return 0;
        }
        int z= ( c1=='p' ? 1:2 );
        cout<<z<<endl;
    }
  }

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program
{
    char a,b;
    cin>>a>>b;
    if(a==b)
    cout<<"T"<<endl;
    else if(a=='r' && b=='s')
    cout<<"1"<<endl;
    else if(a=='p' && b=='r')
    cout<<"1"<<endl;
    else if(a=='s' && b=='p')
    cout<<"1"<<endl;
    else
    cout<<"2"<<endl;
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>

int main() {
    char a1,a2;
    cin>>a1>>a2;

    if ((a1=='r' && a2=='s') || (a1== 'p' && a2== 'r') || (a1=='s' && a2=='p')) {
        cout<<1<<endl;
    } else if ((a1=='s' && a2=='r') || (a1== 'r' && a2== 'p') || (a1=='p' && a2=='s')) {
        cout<<2<<endl;
    } else {
        cout<<'T'<<endl;
    }
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include <simplecpp>

main_program {

    char playera;
    char playerb;

    cin >> playera ;
    cin >> playerb ;
    

    if( playera == 'r' && playerb == 'r'){
        cout << "T" << endl;

    }

    else if( playera == 'r' && playerb == 'p'){
        cout << "2" << endl;
    }

    else if( playera == 'r' && playerb == 's'){
        cout << "1" << endl;
    }
    //First case

    else if( playera == 'p' && playerb == 'p'){
        cout << "T" << endl;

    }

    else if( playera == 'p' && playerb == 'r'){
        cout << "1" << endl;
    }

    else if( playera == 'p' && playerb == 's'){
        cout << "2" << endl;
    }
    //Second case

    else if( playera == 's' && playerb == 's'){
        cout << "T" << endl;

    }

    else if( playera == 's' && playerb == 'r'){
        cout << "2" << endl;
    }

    else if( playera == 's' && playerb == 'p'){
        cout << "1" << endl;
    }
    //Third case

}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{
    char p1,p2;
    cin>>p1>>p2;
    if((p1=='s'&&p2=='r')||(p1=='r'&&p2=='p')||(p1=='p'&&p2=='s'))
    cout<<"2"<<endl;
    else if((p2=='s'&&p1=='r')||(p2=='r'&&p1=='p')||(p2=='p'&&p1=='s'))
    cout<<"1"<<endl;
    else{cout<<"T"<<endl;}
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp> 

main_program {
    char p1 , p2;
    cin >> p1 >> p2;
    if (p1 == p2) cout << "T";
    else if (p1 == 'r') {
            if (p2 == 'p') cout << 2 ; 
            if (p2 == 's') cout << 1;}
    else if (p1 == 'p') {
            if (p2 == 's') cout << 2 ; 
            if (p2 == 'r') cout << 1;}
    else if (p1 == 's') {
            if (p2 == 'r') cout << 2 ; 
            if (p2 == 'p') cout << 1;}
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{
char c;
cin>> c ;
if (c == 'r s'|| c =='s p'|| c == 'p r')
cout<<1<<endl;
else if (c == 'r p'|| c == 's r'|| c == 'p s')
cout<<2<<endl;
else if (c == 'r r'|| c == 's s'|| c == 'p p')
cout<<"T"<<endl;
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: B
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{
   char a,b;
   cin>>a>>b;
   if(a==b){
    cout<<"T";
   }
   else if((a=='r'&&b=='s')||(a=='p'&&b=='r')||(a=='s'&&b=='p') ){
     cout<<"1";
   }
   else if((a=='r'&&b=='p')||(a=='p'&&b=='s')||(a=='s'&&b=='r') ){
     cout<<"2";
   }
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
int main(){
//char r,s,p;
//r=rock, s=scissors, p=paper;
char a,b;
cin>>a>>b;
if(a=='s' && b=='r' )
cout<<"2";
else if (a=='p' && b=='s')
cout<<"2"; 
else if(a=='r' && b=='p')
cout<<"2";
else if(a=='r' && b=='s') 
cout<<"1";

else if( a=='p' && b=='r')
cout<<"1";
 
else if( a=='s' && b=='p')

cout<<"1";
if(a==b)
cout<<"T";
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include <simplecpp>


void Game(char p1, char p2){
bool tie = false;
  if(p1 == p2) {
    cout << "T";
    tie = true;
  }

  if(p1 == 'p' && tie == 0){
     if(p2 == 'r') cout<< "1";
     else cout <<"2";
    
  }
  if(p1 == 'r' && tie == 0){

    if(p2 == 's' && tie == 0) cout << "1";
    else cout <<"2";
  }

  if(p1 == 's' && tie == 0){
     if(p2 == 'p') cout <<"1";
     else cout <<"2";

  }

}


main_program{
  
  char a,b;
  cin >> a>>b;

  Game(a,b);
  

}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>
main_program{
    char p1, p2;
    cin>>p1>>p2;
    if(p1==p2){
        cout<<"T"<<endl;
    }
    if(p1=='r' && p2=='p'){
        cout<<"2"<<endl;
    }
    if(p1=='p' && p2=='r'){
        cout<<"1"<<endl;
    }
    if(p1=='r' && p2=='s'){
        cout<<"1"<<endl;
    }
    if(p1=='s' && p2=='r'){
        cout<<"2"<<endl;
    }
    if(p1=='p' && p2=='s'){
        cout<<"2"<<endl;
    }
    if(p1=='s' && p2=='p'){
        cout<<"1"<<endl;
    }
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include<simplecpp>

struct player{
  char  object;

};
main_program{
    player player1;
    player player2;
    char r,p,s;
    cin>>player1.object>>player2.object;
    if(player1.object== 'r' && player2.object=='r'){
        cout<<'T';
    }
    if(player1.object=='s' && player2.object=='s'){
        cout<<'T';
    }
    if(player1.object=='p' && player2.object=='p'){
        cout<<'T';
    }
    if(player1.object=='s' && player2.object=='p'){
        cout<<"1";
    }
    if(player1.object=='s' && player2.object=='r'){
        cout<<"2";
    }
      if(player1.object=='p' && player2.object=='r'){
        cout<<"1";
    }
      if(player1.object=='p' && player2.object=='s'){
        cout<<"2";
    }
      if(player1.object=='r' && player2.object=='p'){
        cout<<"2";
    }
      if(player1.object=='r' && player2.object=='s'){
        cout<<"1";
    }
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: A
Problem: Rock-Paper-Scissors is a simple game played by two people, where the two players simultaneously gesture any one of the three objects ‘rock’, ‘paper’, or ‘scissors’. The rules are straightforward: rock beats scissors, scissors beats paper, and paper beats rock. The outcome of each round is a win for the player whose object beats that of the other player, or a tie if both players choose the same object. For example, if player 1 chooses rock and player two chooses paper, then player 2 wins as paper beats rock. 

Write a C++ program to accept two characters as input from the user. These denote the choice made by player 1 and player 2, respectively. The choices would be r for rock, p for paper, and s for scissors. Print which player wins (1 or 2, or T for tie). 

Input Format Two characters in lowercase. 

Output Format 1 or 2 or T 

Assumptions on Input Assume that the characters input by the user will be either r, p, or s.

Student submission:
#include <simplecpp>

main_program
{
    string a,b;
    cin>>a>>b;
    if(a==b)
    {
        cout<<"T";
    }
    else if(a=="r" && b=="s")
    {
    cout<<"1";
    }
    else if(a=="r" && b=="p")
    {
   cout<<"2";     
    }
    else if(a=="p" && b=="s")
    {
     cout<<"2";   
    }
    else if(a=="p" && b=="r")
    {
      cout<<"1";  
    }
    else if(a=="s" && b=="r")
    {
      cout<<"2";  
    }
    else if(a=="s" && b=="p")
    {
      cout<<"1";  
    }
}

Grading criterion: Declaration of variables
Rating A: correctly declares the two variables as char
Rating B: Some issue.
Rating C: Major issue.
Rating D: 0
Assigned grade: B