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 y;
	cin >> y;
	double w,x=0;
	w = y/100000000;
	for(double k=0;k<100000000;k++){
		x+= w/sqrt(1-((k)*(k)*w*w));
	}
	cout << fixed;
	cout.precision(3);
	cout << x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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{
//we will solve this by rienman integration
// we would divide 1 to y into  500000000 divisions for acuracy otherwise at 1 it will show 1.56... for 100000 iterations .
// due to this it will take time to compute value at 1.
	double y;
	cin>>y;
	long double x=0,w=y/500000000.0;
	 long  int i=0;
	repeat(500000000){
	x+=(1.0/(sqrt(1-i*i*w*w)))*w;
	i++;}
cout<<fixed;
cout.precision(3);
cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 y;
	cin>>y;
	float a,b;
	a=0;
	b=PI/2;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 x=y,a=y,i=1;
	repeat(100000000){
		a=a*pow(y,2)*(2*i-1)*(2*i-1)/((2*i+1)*2*i);
		x=x+a;
		i=i+1;
	}


	cout<<fixed;
	cout.precision(3);
	cout<<x<<endl;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 y,espi;
	cin>>y;
	espi = 0.000000001;
	float x=0;
	while ((sin(x)-y)>=espi) {
		x += ((sin(x)-y)/cos(x));
		y += espi;
	}
	cout<<x<<endl;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 x=0;
	double n=1;
	for (int i=0;i<=100000000;i++)
	{
		
		x=x+(pow(y,2*i+1)*n)/(2*i+1);
		n=n*(float((2*i+1))/((i+1)*2));
		
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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
{
	double y,xr=PI/2.0,xl=0,xm=(xl+xr)/2.0,delta=0.00001;
	cin>>y;
	bool xlpos = sin(xl)-y>0,xmpos = sin(xm)-y>0;
	while((xm-xl)>=delta)
	{
		xm=(xl+xr)/2;
		if(xmpos)
		{
			if(xlpos){xl=xm;}
			else{xr=xm;}
		}
		else{if(xlpos){xr=xm;}
			else{xl=xm;}
		
		}
		xm=(xl+xr)/2;
	}
	cout<<fixed;
	cout.precision(3);
	cout<<xm;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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
{
	// We use the Bisection method to solve the function
	// f(x) = sin(x) - y
	// We wish to find the root of this function to three decimal spaces
	// Since y is between 0 and 1
	// f(0) <= 0 and f(PI/2) >= 0.
	// Also only one root of the function will exist between 0 and Pi/2
	// So we let  x_l = 0, x_r = Pi/2 Initially
	
	// Taking input
	double y;
	cin >> y;
	double x_l, x_r, x_m;

	// Initializing x_l and x_r
	x_l = 0;
	x_r = M_PI / 2;

	// After n iterations x_r - x_l = PI/(2 ^ (n + 1))
	// And the root always lies between x_r and x_l
	// After 15 iterations x_r - x_l < 10^(-4)
	// So x_l will be withinn 10^(-4) of the root
	// Hence x_l will approximate to root upto three decimal points properly
	for (int i = 0; i < 15; i++)
	{
		x_m = (x_l + x_r) / 2;
		if (sin(x_m) - y > 0)
		{
			x_r = x_m;
		}
		else
		{
			x_l = x_m;
		}
	}

	// Printing the calculated root
	cout << fixed;
	cout.precision(3);
	cout << x_l << endl;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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<iostream>
using namespace std;
float pow(float x, int y){
for(int i=1;i<y;i++){
 x=x*x;}
return x;
}
int main(){
  float y;
  cin>>y;
  float x= y+ pow(y,3)/6 + 9*pow(y,5)/120 + 225*pow(y,7)/5040;
  cout<<fixed;
  cout.precision(3);
  cout<<x;
  }

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 x;
	x = (arcsine(y))*(PI/180);
	cout<<fixed;
	cout.precision(3);
	cout<<x<<endl;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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  y;
	cin>>y;
	double x = 0;
	while(sin(x)!=y){
		x+= 1E-10;
		if( x>PI/2) break;
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
	
	

}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 y;
	cin >> y;
	double n = 10000000;
	long int i = 0;
	double w = y/n;
	double value = 0;
	while (i < n)
	{
		double term = w/(sqrt(1 - pow(i*w, 2)));
		value += term;
		i++;
	}
	cout.precision(3);
	cout << value << endl;

}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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{

	double y;
	double x;
	cin>>y;

	for(x=0;x<=(1.571);x=x+(0.001))
	{
	double z=sin(x);

	if(((y-z)<=0.0000001)){
/*		cout << fixed; // uses fixed floating point representation
cout.precision(3); // print three digits after the decimal point
*/	cout<<x<<endl;
		
	}}}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 eps = 1e-12;
	double x; cin >> x;
	double term = x;
	double sum = x;
	double counter =-1;
	while(term > eps) {
		counter += 1;
		term *= (x)*(x)*(counter + 0.5)*(2*counter + 1) / ((counter + 1)*(2*counter + 3));
		sum += term;
	
	}
	cout << fixed;
	cout.precision(3);
	cout << sum;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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>

int main() {
    float xl = 0, xr = PI/2;
    float xm = (xl + xr)/2;
    float y;
    cin >> y;
    while((xr - xl) > 0.00001) {
        if ((sin(xm) - y) > 0) {
            xr = xm;
            xm = (xl + xr)/2;
        } else {
            xl = xm;
            xm = (xl + xr)/2;
        }
    }
    cout << fixed; // uses fixed floating point representation
    cout.precision(3); // print three digits after the decimal point
    cout << xm << endl;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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{
	double y;
	double x=1;
	cin>>y;
	while(abs(y-sin(x))>10E-100){
		x=x-(sin(x)-y)/(sqrt(1-(sin(x)*sin(x))));
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 term=y,ans=y;
	int k=1;
	repeat(20){
		term=term*(2*k-1)*(2*k-1)*y*y/((2*k+1)*k*2);
		ans=ans+term;
	}
cout<<fixed;
cout.precision(3);
	cout<<ans;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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{
	double y;
	cin>>y;
	float epsilon=1.0E-20;
	double x=0;
	while(0<=x&&x<=PI/2){
		if(y==sine(x)){
			cout<<fixed;
		        cout.precision(3);
			cout<<x<<endl;}
		else x=x+epsilon;

	}
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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;
for(double i=0.0;i<=1.571;i=i+0.00000001){
	if ((sin(i)*1000)/10==y*100)cout<<i;
	else continue;
}
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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,y;cin>>y;
	
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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=0.0;
	while(true){
		long double e;
		e=(sin(x)) -y;
		if(e<0.0000001 && e>-0.000000001) break;
		x=x+0.0000001;}
	cout<<fixed;
	cout.precision(3);
	cout<<x<<endl;
	
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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>
double sinx_inverse(double x){
        double sinx_inverse;
        sinx_inverse=x+x*x*x/6+x*x*x*x*x*x*3/40+x*x*x*x*x*x*x*5/84+x*x*x*x*x*x*x*x*x*35/144+x*x*x*x*x*x*x*x*x*x*x*63/(4*64*11)+x*x*x*x*x*x*x*x*x*x*x*x*x*7*99/(4*64*12*13);
        return sinx_inverse;
}
main_program{
        double x;
       cin>>x;
cout<<fixed;
cout.precision(3);
cout<<sinx_inverse(x)<<endl;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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{
double y;
cin>>y;
double term=y,sum=y;
int i=1;
while(abs(sin(sum)-y)>0.0000001){
	term=term*(y*y)*((2*i)-1)*((2*i)-1)/(((2*i)+1)*(2*i));
	sum=sum+term;
        i++;
}
cout<<sum<<endl;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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
{
	double y,x;
	cin>>y;

}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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= PI/4;//chosing any arbitory value for initialization
	while (abs(sin(x)-y)>1.0E-20) {
		x = x - ((sin(x)-y)/cos(x));
	}
	if ( x>PI/2) {
		while(x>PI/2) {
			x = x - 2*PI;
		}
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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;
	long double x=1;
	cin>>y;
	repeat(5000){
		x=x-(sin(x)-y)/cos(x);
	}
	x=x+0.0002;
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 x=PI/4;
	repeat(5000){
		x= x -tan(x) + y/cos(x) ;
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x<<endl;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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 sum=0,t=y
		t=t*(-1)*y*y(2)*(+1)
	cout<<y;
	cout<<fixed;
	cout.precision(3)
	}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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,y;cin>>y;
	repeat(700){
		x=x-(sin(x)-y)/cos(x);
	}
	cout<<fixed;cout.precision(3);cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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{
	double y,x=1;
	cin>>y;
	repeat(100){
		x = x - (sin(x)-y)/cos(x);
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
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{
	long double y;
	long double x=0;
	cin>>y;
	float dx = 0.00001;
	float i = 0;
	while (i <=y)
	{
		x = x + 0.00001/pow(1-i*i,0.5);
		i = i + dx;
	}
	cout<<fixed;
	cout.precision(3);
	cout<<x;
}

Grading criterion: Quality of Variable Names
Rating A: Good variable names
Rating B: Ok Variable Name
Rating C: Poor Variable Names
Rating D: 0
Assigned grade: B