CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
int n;
cin >> n;
if (n<-1000 || n>1000) {
	
	cin >> n;
}	
int a=0;
float b=0;
if (n<0 && n%2==0){
       a=n/2;
       cout <<a << endl;
}
if (n<0 && n%2!=0) cout << n*n <<endl;
if (n>0 && n%2==0){
       b=n/3.0;
       cout <<b << endl;
}
if (n>0 && n%2!=0) cout << n*n*n << endl;
if (n==0) cout << "00" << endl;
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n;
	cin>>n;
        int negative;
	int positive;
	int even;
	int odd;

	if(n==negative && n==even){
		cout<<n/2<<endl;
	}
	if(n==negative && n==odd){	
		cout<<n*n<<endl;
	}
	if(n==positive && n==even){
		cout<<n/3<<endl;
	}
	if(n==positive && n==odd){
		cout<<n*n*n<<endl;
	}
	if(n==0){
		cout<<00<<endl;
	}

}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program
{
  int n;
  cin>>n;
  if((n<0) && (n%2==0))
  {
    cout<<n/2;
  }
  else if((n<0)  && (n%2!=0))
  {
   cout<<n*n;
  }
  else if((n>0) && (n%2==0))
  {
   float i= n*(1.0)/3;
   cout<<i;
  }
  else if((n>0) && (n%2!=0))
  {
    cout<<n*n*n;
  }
  else
  {
   cout<<"00";
  }
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n;
	float t;
	cin>>n;
	t=n;
	if(n<0 && n%2==0){
		cout<<n/2;
	}
	if(n<0 && n%2!=0){
		cout<<n*n;
	}
	if(n>0 && n%2==0){
		cout<<(1.0*t)/3.0;
	}
	if(n>0 && n%2!=0){
		cout<<n*n*n;
	}
	if(n==0){
		cout<<"00";
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n;
	cin>>n;
	while(n<=1000 && n>=-1000){
	if(n<0 && n%2==0){
		cout<<n/2.000;}
	if(n<0 && n%2!=0){
		cout<<n*n;}
	if(n>0 && n%2==0){
		cout<<n/3.000;}
	if(n>0 && n%2!=0){
		cout<<n*n*n;}
	if(n==0){
		cout<<n<<n;}
	else {break;}}}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include <simplecpp>
main_program{
int n;
cin>>n;
bool l=n>0;
bool k= (n%2==0);
if (n==0){

cout<<0<<0;
}
else{
 if(l && k){
   float f=n*1.0/3;
   cout<<f;

} 
 if (!l &&k){
   float f=n/2;
   cout<<f;

}
 if(l&&!k){
   int f=n*n*n;
   cout<<f;
 
 } 
 if(!l && !k){
   int f= n*n;
   cout<<f;
 
 }

}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n;
	cin>>n;
	if(n<0){
		if(n%2==0){
			cout<<n/2;}
		else{
			cout<<pow(n,2);}}
	else if(n>0){
		if(n%2==0){
			cout<<n/3.0;}
		else{
			cout<<pow(n,3);}}
	else{
		cout<<"00";}}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include <simplecpp>
main_program
	{
int n;
cin>>n;

if (n<0 && n%2==0) cout<<n/2;
if (n<0 && n%2!=0) cout<<n*n;
if (n>0 && n%2==0) cout<<n/3.0;
if (n>0 && n%2!=0) cout<<n*n*n;
if (n==0)  cout<<n<<n;
	}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

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

int main(){
	int n;
	cin>>n;
	if(n<0&&n%2==0){
		cout<<n/2;
	}
	else if(n<0&&n%2==-1){
		cout<<n*n;
	}
	else if(n>0&&n%2==0){
		cout<<(n*1.0)/3;
	}
	else if(n>0&&n%2==1){
		cout<<n*n*n;
	}
	else{
		cout<<0<<0;
	
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
       int n;
cin>>n;
if(n<0&&n%2==0){cout<<n/2;}
if(n<0&&n%2!=0){cout<<n*n;}
if(n>0&&n%2==0){cout<<float(n/3.0);}
if(n>0&&n%2!=0){cout<<n*n*n;}
if(n==0){cout<<"00";}}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>

main_program {
	int n;
	cin >> n;
	if (n == 0) {
		cout << "00" << "\n";
	}
	else {
		bool sign = true;//Positive
		bool even = true;//Even
		if (n < 0) {
			sign = false;
		}
		else {
			sign = true;
		}
		if ((n % 2) == 0) {
			even = true;
		}
		else {
			even = false;
		}
		if ((sign == false) && (even == true)) {
			int j = n/2;
			cout << j << "\n";
		}
		else if ((sign == false) && (even == false)) {
			int j = n * n;
			cout << j << "\n";
		}
		else if ((sign == true) && (even == true)) {
			float j = (float) n / 3;
			cout << j << "\n";
		}
		else if ((sign == true) && (even == false)) {
			int j = pow(n,3);
			cout << j << "\n";
		}
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n= (1 to 100);
	n= even;

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include <simplecpp>
main_program {
   	int n;
	float c;
	cin >> n;
	if(n<0 && n%2==0) {
		cout<< n/2;
	}
	if(n<0 && n%2!=0) {
		cout << n*n;
	}
	if(n>0 && n%2==0) {
		c=n/3.0;
		cout<< c;
	}
	if(n>0 && n%2!=0) {
		cout << n*n*n;
	}
	if(n==0) {
		cout << "00";
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n;
	cin>>n;
	if(n<0 && (n%2)==0){
	      int a;//assuming compute implies to show that in another variable rather than printing it directly
              a=n/2;	      
	cout<<a<<endl;
	}
	if(n<0 && (n%2)!=0){ 
	cout<<n*n<<endl;
	}
	if(n>0 && (n%2)==0){
	 float b;//assuming b as float seeing the practice test case for 724
	 b=n/3.0;	 
        cout<<b<<endl;			
        }
	if(n>0 && (n%2)!=0){ 
	cout<<n*n*n<<endl;
	}
	if(n==0){ 
	repeat(2){
       cout<<"0";
	}
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
int n;
cin>>n;
if(n<0&&n%2==0)
cout<<n/2;
if(n<0&&n%2!=0)
cout<<n*n;
if(n>0&&n%2==0)
cout<<n/3;
if(n>0&&n%2!=0)
cout<<n*n*n;
if(n==0)
cout<<"00";
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include <simplecpp>

main_program{
	int n;
	cin>>n;;
	if(n<0 && n%2==0){
		float d = n/2.0;
		cout<<d<<endl;
	}
	else if(n<0 && n%2!=0){
		float sq = n*n;
		cout<<sq<<endl;
	}
	else if(n>0 && n%2==0){
		float d = n/3.0;
		cout<<d<<endl;
	}
	else if(n>0 && n%2!=0){
		int cb = n*n*n;
		cout<<cb<<endl;
	}
	else{
		cout<<0<<0<<endl;
	}

}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
int n;
cin >> n;


if(n<0 && (n*(-1))%2==0) cout << n / 2;
if(n<0 && (n*(-1))%2!=0) cout << n * n;
if(n>0 && n%2==0) cout << n / 3.0;
if(n>0 && n%2!=0) cout << n*n*n;
if (n==0) cout << "00";
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
float a;
int n;
cin>>n;
if((n<0) && ((n%2)==0)){
cout<<(n/2)<<endl;}
else if((n<0) && ((n%2) !=0)){
cout<<(n*n)<<endl;}
else if((n>0) && ((n%2)==0)){
a=n;
cout<<a/3<<endl;}
else if((n>0) && ((n%2) !=0)){
cout<<(n*n*n)<<endl;}
else if(n==0){
cout<<"0"<<"0"<<endl;}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include <simplecpp>

main_program{
	int n;
	cout << "n: ";
        cin >> n;
	if(n<0 && n%2==0) cout << n/2 << endl;
	if(n<0 && n%2==1) cout << (n*n) << endl;
	if(n>0 && n%2==0) cout << (n/3) << endl;
	if(n>0 && n%2==1) cout << (n*n*n) << endl;
        if(n==0) cout << "00" << endl;

}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
int n;
long double ans;
float a;
cin>>n;
a=n;
	if (n<0){
		if(n%2==0){
		ans=n/2;
		}
		else{
		ans=n*n;
		}
		cout<<ans;
	}
	else{
		if(n%2==0){
		ans=(n*1.0)/3;
		}
		else{
		ans=a*a*a;
		}
		cout<<ans;
	}
	if(n==0) {cout<<"0";}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: Untitled Rating
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>

main_program{
	int n;
	cin>>n;
	if(n<0 && n%2==0)
	{
		cout<<n/2;
	}
	else if(n<0 && n%2!=0)
	{
		cout<<n*n;
	}
	else if(n>0 && n%2==0){
		cout<<(n*1.0)/3;
	}
	else if(n>0 && n%2!=0)
	{
		cout<<n*n*n;
	}
	else if(n==0)
	{
		cout<<"00";
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include <simplecpp>
main_program{
	long int n ;
	int res1 ;
	double res2;
	cin >> n ;
	if ( n<0 && n%2==0){
		res2  =float( n)/2;
		cout << res2;
	}
	else if ( n<0 && n%2!=0){
		res1 = n*n;
		cout << res1;
	}
	else if ( n>0 && n%2==0){
		res2  = float( n)/3;
		cout << res2;
	}
	else if ( n>0 && n%2!=0){
		res1 = n*n*n;
		cout << res1;
	}
	else if ( n==0){
		cout << "00";
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n,p;

	cin>>n;
	if(n>=-1000 && n<=1000){
	if(n<0){
		p=-1*n;
		if(p%2==0){double f;
			f=n/2;
			cout<<f;}
		if(p%2!=0){
			cout<<n*n;}
	}
	if(n>0){
		if(n%2==0){double k;
			k=n/3;
			cout<<k;}
		if(n%2!=0){
			cout<<n*n*n;}
	}
	if(n==0){
		cout<<00;
	}}}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n;
	cin>>n;
	if(n<0){
		if(n%2==0){ cout<<n/2;}
		else{ cout<<n*n;}
	}
	else if(n>0){
		if(n%2==0){ cout<<n/3.000;}
		else{ cout<<n*n*n;}
	}
	else{
		cout<<"00";
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n;
	cin>>n;
	if ( n<0 && n%2==0){
		cout<<n/2<<endl;
	}
	if ( n<0 && n%2!=0){
                cout<<n*n<<endl;
        }
	if ( n>0 && n%2==0){
		double m = n;
                cout<<m/3<<endl;
        }
	if ( n>0 && n%2!=0){
                cout<<n*n*n<<endl;
        }
	if ( n==0){
                cout<<"00"<<endl;
        }
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n;
	cin >> n;
	if (n<0 && n%2==0){
		cout << n/2;
	}
	else if (n<0 && n%2!=0){
		cout << n*n;
	}
	else if (n>0 && n%2==0){
		cout << n*1.0/3;
	}
	else if (n>0 && n%2 != 0){
		cout << n*n*n;
	}
	else if (n==0){
		cout << "00";
	}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program{
	int n, a;
	cin>>n;
	a=n%2;
	if(n<0){
		if(a==0) cout<<n/2;
		else cout<<n*n;
	}
	else if (n>0){
		if(a==0) cout<<n/3.0;
		else cout<<n*n*n;
	}
	else cout<<"00";
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Write a program that accepts a number n from the user and performs a specific operation as given belowIf n is negative and even, compute n/2 and print the resultIf n is negative and odd, print the square of nIf n is positive and even, compute n/3 and print the result.If n is positive and odd, print the cube of nIf n is zero, print the number 0 two times i.e print 00

Constraints (Assume) 10^3 <=n <=10^3

Student submission:
#include<simplecpp>
main_program {int n;
	cin >> n;
	if(n<0 && n%2==0){cout << n/2;}
	if(n<0 && n%2!=0){cout << n*n;}
	if(n>0 && n%2==0){float s = n/3.0;
		cout << s;}
	if(n>0 && n%2!=0){cout << n*n*n;}
	if(n==0){cout << "00";}
}

Grading criterion: Correct I/O incl. Format
Rating A: I/O Handled correctly
Rating B: Error in I/O
Rating C: 0
Rating D: 0
Assigned grade: A