CodeGraderBench/CodeGraderBench huggingface dataset:
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double x=0,y,c;
	double k=1;
	cin>> y;
	c=y;
	repeat(1000000000){
		x=x+y;
		
		y=y*c*c*(2*k-1)*(2*k-1)/(2*k*(2*k+1));
		k=k+1;
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x<<endl;
}

Grading criterion: E.g. Use of functions beyond what was instructed or any other code quality
Rating A: Modularity, Extra Functions Defined
Rating B: No extra things
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include <simplecpp>
main_program {
	double y;
	cin>> y;
	float sum=0,t=y;
	int i=0;
	repeat(100000000) {
		sum=sum+t;
		t=t*y*y*(2*i+1)*(2*i+1)/(2*i+3)/(2*i+2);
		i++;

	};
	

	cout << fixed;
	cout.precision(3);
	cout << sum;
}

Grading criterion: E.g. Use of functions beyond what was instructed or any other code quality
Rating A: Modularity, Extra Functions Defined
Rating B: No extra things
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double y;
	cin>>y;
	double x1=0,x2=PI,x3=(x1+x2)/2;
	double k=sin(x3)-y;
	while(abs(k)>1.0e-1){
		if ((sin(x3)-y)*(sin(x2)-y)<0){
			x1=x3;
			x3=(x1+x2)/2;
		}
		else{
			x2=x3;
			x3=(x1+x2)/2;
		}
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x3;
}

Grading criterion: E.g. Use of functions beyond what was instructed or any other code quality
Rating A: Modularity, Extra Functions Defined
Rating B: No extra things
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	int a=1;
	int i=1;
	float b;
	float x;
	float ans;
	cin>>ans;
	b=x;
		a=a*(i+1)*(i+2);
		b=b*pow(x,2)*(-1);
		ans=x+b/a;

i=i+1;
cout<<x<<endl;

}

Grading criterion: E.g. Use of functions beyond what was instructed or any other code quality
Rating A: Modularity, Extra Functions Defined
Rating B: No extra things
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program {
	double x=0.5;
	double y;
	cin >> y;

	repeat(1000){
		x = (x*cos(x) - sin(x) + y)/cos(x);
	}
	cout<<fixed;
	cout.precision(3);
	cout << x;
}

Grading criterion: E.g. Use of functions beyond what was instructed or any other code quality
Rating A: Modularity, Extra Functions Defined
Rating B: No extra things
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program {

	float n =2000000,i=0,y = 0;
	double w,x;
	cin >> x;
	int b;
	b = n*x;
        
	repeat (b) {
                
		w = i/n;
		y = y +(1/(sqrt(1-w*w)))*(1/n);
		i++;
		    
		     }
	cout<<fixed;
	cout.precision(3);
	cout<<y;

}

Grading criterion: E.g. Use of functions beyond what was instructed or any other code quality
Rating A: Modularity, Extra Functions Defined
Rating B: No extra things
Rating C: 0
Rating D: 0
Assigned grade: A
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
float value(float n, float y) {
	float result = 0;
	for(int i = (1/n); i < y; i+=(1/n)) {
		result += ( 1/(sqrt(1 - ((i-(1/n))*(i-(1/n)))))*(1/n));
	}
	return result;
}
main_program {
	float y;
	cin >> y;
	float n = 5000;
	float res = 0;
	while(y - sin(res) > 0.001) {
		n+=5000;
		res = value(n, y);
	}
       cout << fixed;
	cout.precision(3);
 	cout << res;	
}

Grading criterion: E.g. Use of functions beyond what was instructed or any other code quality
Rating A: Modularity, Extra Functions Defined
Rating B: No extra things
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double x=0,y;
	cin>>y;
	repeat(100){
		x=x-((sin(x)-y)/(cos(x)));
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: E.g. Use of functions beyond what was instructed or any other code quality
Rating A: Modularity, Extra Functions Defined
Rating B: No extra things
Rating C: 0
Rating D: 0
Assigned grade: B
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>

main_program{
	double x;
	cin >> x;

        double y=0;
	while(sin(y)<x && y<=PI/2){
		y+=0.0001;
	}
	cout << fixed;
	cout.precision(3);
	cout << y;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double x=PI/4;
	double y;
	cin>>y;
	while(((sin(x)-y)>0.00000001)||((sin(x)-y)<-0.00000001)){
		x=x-(sin(x)-y)/cos(x);
	}
	cout << fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double y;
	cin>> y;
	double term=1,sum=0,i=2;
	term = term*y;
	sum = sum+term;
	repeat(20){
		term = (term*(-1)*pow(y,2))/i*(i+2);
		sum = sum + term;
                }
         cout<< fixed;
         cout.precision(3);
         cout<< sum << endl;
	 }

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program 
{
	float y;
	cin>>y;
	float x =1;
	if((y>=0&&y<=1)){
	while(abs(sin(x)-y)>0.00000000000001)
	{
		x = x - (sin(x)-y)/cos(x);
	}
	if(x>=0&&x<=PI/2)
	{
        cout<<fixed;
	cout.precision(3);
	cout<<x;
	}
}
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	float y;cin>>y;
	float x;
	float term=x,sum=0;
	int k=1;
	if(0<=y<=1,0<=x<=1.571){
		repeat(1000){
		        sum=sum+(term);
		        term=(term*(-1)*pow(x,2))/(4*k*k+2*k);
		        k=k+1;
		}
		y=sum;
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double b=PI/2;
	double a=0;
	double y;
	cin>>y;
	while(abs(sin((a+b)/2)-y)>0.0001&&y<1&&y>0){
		if(sin((a+b)/2)>y)
			b=(a+b)/2;
			
		 else if(sin((a+b)/2)<y)
			a=(a+b)/2;
		else if(sin((a+b)/2)==y)
			 break;
	}
	double c=(a+b)/2;
	if(y==0)
	c=0;
	if(y==1)
		c=PI/2;
	cout<<fixed;
	cout.precision(3);
	cout<<c;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
double x,y;
cin >> y;
// sinx = x - x^3/3! ;
float delta = 0.001;
for(int i = 0; i<x;i++){
	

}


}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include <simplecpp>

main_program{

	double y;
	cin>>y;


	double x;
	double l=0;
	double u=PI/2;

	for(int i=0;i<=1000;i++){

		if((sin((u+l)/2)-y)>=0){u=(u+l)/2;}
		else{l=(u+l)/2;}
	}
	x=(u+l)/2;
	cout << fixed; // uses fixed floating point representation
	cout.precision(3); // print three digits after the decimal point
	cout<<x;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include <simplecpp>
main_program{
	float y;
	cin>>y;
	float x=1;
	repeat(1000){
	x=(x*cos(x)-sin(x)+y)/cos(x);
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program {
	float y;
	cin >> y;
	float x;
	x=(arcsine(y))*PI;
	x=x/180;
	cout << x;
	cout.precision(3);
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	int x;
	int y;

	cin >> 0 <= y <= 1;
	cin >> 0 <= x <= PI/2;









	cout << fixed;	// uses fixed floating point representation
	cout.precision(3); //  print three digits after the decimal point

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double y;//y is between 0 and 1
	cin>>y;
	double x1=0,x2=PI/2;
	//The function is sin x-y.I am using bijection method to compute roots.
	//Let x represent mean of x1 and x2 and b represent the boolean variable that shows the sign of sin x-y
	//Let us use bijection till sin x and y are epsilon close.Here we take epsilon 1e-20 which is more than enough for 3 decimal
	// accuracy
	float epsilon=pow(10,-20);
	double x=(x1+x2)/2;
	bool b=(sin(x)-y)>0;
	while ((sin(x)-y)>epsilon || (sin (x)-y)<-1*epsilon)  //To show that when absolute value of sin x-y is more than epsilon
	{
		if (b==true)
		{
			x2=x;
		}
		else x1=x;
		x=(x1+x2)/2;
		b=(sin(x)-y)>0;
	}
	cout<< fixed;
	cout.precision(3);
	cout<<x<<endl;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: A
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
float y;
cin>>y;

float x;
x=arcsine(y);
float ans=(PI/180)*x;
      
     cout<<fixed;
     cout.precision(3);
     cout<<ans;
     





}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include <simplecpp>
main_program {

      double y;
      cin>>y;
      double x=0;
      while(y-sin(x)>0.00000001) {x=(-sin(x)+x*cos(x)+y)/cos(x);}
      cout<<fixed;
	cout.precision(3);
        cout<<x; }

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program
{
	long double x,y;
	cin>>y;
	x=1;
	while(abs(sin(x)-y)>0.000000000000001)
	{
		x=x-(sin(x)-y)/cos(x);
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x<<endl;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double y,xL=0,xR=PI/2,xM;
	cin>>y;
	while(xR-xL > 0.00000001){
		xM = (xR+xL)/2;
		if ((sin(xL)-y)*(sin(xM)-y)<0){
			xR = xM;
		}
		else {
			xL = xM;
		}
	}
	cout<<fixed;
	cout.precision(3);
	cout<<xR;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double y;
	cin>>y;
	double e=0.0000001;
	double x=1.0;
	while(abs(sin(x)-y)>e){
		x=x-tan(x)+y/cos(x);
	}
	cout<<fixed;
	cout.precision(3);
	cout<<abs(x)<<endl;
	
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double y,x=0.5;
       	cin>>y;
	double exp=(sin(x)-y),epsilon=1.0e-15; //Consider function sin(x)-y. Then our goal is jus to find zeroes of this equation for a given value of y

	//Using Newton-Raphson iterations to compute the root of the given equation
	while (abs(exp)>=epsilon){
		x=x-tan(x)+(y/cos(x));
		exp=(sin(x)-y);}
	cout<<fixed;
	cout.precision(3);
	cout<<x<<endl;
	

	}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: A
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	float y;
	cin>>y;
	float xl,xm;
	xl=0;
	xm=PI/2;
	while ((xm-xl)>0.001){
		if(y<(sin((xl+xm)/2))){
			xm=(xl+xm)/2;
			
		}
		if (y>sin((xl+xm)/2)){
 			xl=(xl+xm)/2;
	
		}
	}
	
		float x=(xl+xm)/2;
		cout.precision(3);
		cout<<x;
		cout<<endl;
		}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>
main_program{
	double y;
	cin>>y;

	


	double x1=0.0;
	double x2=90.0;

	while (abs(sine((x1+x2)/2)-y)>=0.000000001)
	{

	if(sine((x1+x2)/2)>=y)
	{
		x1=x1;
		x2=(x1+x2)/2;
	}

	else
	{
		x1=(x1+x2)/2;
		x2=x2;
	}
	}

	cout<<fixed;
	cout.precision(3);

	cout<<((x1+x2)/2)*PI/180.0;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C
Problem: Given a real number y   [0,1], find the value of x, in radians, such that sin(x) = y, without using any trigonometric-inverse function. The value x should lie within the interval [0, pi(3.14) /2]. Write an iterative program that prints the value of x. Do NOT use a brute-force search at all.

Constraints

0 <= y <= 1

0 <= x <=  pi (3.14) /2

Student submission:
#include<simplecpp>

main_program{

	double y;
	cin>>y;

	double xl=0;
	double xr=PI/2;

	for(int i=0; i<1000; i++){
		double x= (xl+xr)/2.0;

		if((sin(x)-y)>=0){
			xr = x;
		}else{
			xl=x;
		}

	}

	cout<<fixed;
	cout.precision(3);
	cout<<xr;
}

Grading criterion: Quality and number of Comments
Rating A: Well Commented and Formatted
Rating B: Ok Commented or Ok Formatted
Rating C: Poor Comments and Formatting
Rating D: 0
Assigned grade: C