var ch=Math.PI/180var a=new Array()var c=new Array()var d=new Array()var xvar yvar g=0var grade=new Array()var gradeOA=0var II=0var JJ=0var nump=10msg=open("ins.html","msg","width=320,height=320,toolbar=yes,directories=no,menubar=yes,scrollbars=yes")msg.document.close()function pins(obj,obj2){if(obj2!="0"){JJ=eval(parseFloat(obj2)-1)//alert(JJ)//obj.prob[JJ].checked=falsed[II]=obj2//alert(d[II])for(i=0;i<d.length;i++){if(obj2==d[i]){grade[i]=0;}}document.forms[1].results.value+="\r"+obj.result.valueobj.result.value=" "obj.idx.value=obj2II=eval(parseFloat(II)+1)switch(parseFloat(obj2)){case 1:x=Math.round(eval(Math.random()*8+1)*1)/1y=Math.round(eval(Math.random()*8+1)*1)/1z=Math.round(eval(Math.random()*8+1)*1)/1obj.result.value+='Problem 1:\rx='+x+', y='+y+' and z='+z+', what is (x+y)*z? '+'What is x+y*z?'+'\n'+'_____________________'+'\n'break;case 2:x=Math.round(eval(Math.random()*9+1)*1)/1y=Math.round(eval(Math.random()*9+1)*1)/1z=Math.round(eval(Math.random()*10+1)*1)/1obj.result.value+='Problem 2:\rx='+x+', y='+y+' and z='+z+', what is z*(x+y)? '+'What is x*z+y*z?'+'\n'+'_____________________'+'\n'break;case 3:x=Math.round(eval(Math.random()*8+1)*1)/1y=Math.round(eval(Math.random()*8+1)*1)/1z=Math.round(eval(Math.random()*8+1)*1)/1obj.result.value+='Problem 3:\r'+x+'*x+'+y+'='+z+', what is x to two decimal places?'+'\n'+'_____________________'+'\n'break;case 4:x=Math.round(eval(Math.random()*8+2)*10)/10y=Math.round(eval(Math.random()*19+1)*10)/10obj.result.value+='Problem 4:\r'+x+'x+5='+y+'x+10, what is x to 4 decimal places?'+'\n'+'_____________________'+'\n'break;case 5:x=Math.round(eval(Math.random()*6+6)*10)/10y=Math.round(eval(Math.random()*2+.5)*10)/10obj.result.value+='Problem 5:\r('+x+'x+4)/(2x+8)='+y+', solve for x to 3 decimal places.'+'\n'+'_____________________'+'\n'break;case 6:x=Math.round(eval(Math.random()*8+2)*1)/1y=Math.round(eval(Math.random()*10+4)*1)/1obj.result.value+='Problem 6:\r4x+'+x+'='+y+'+4, express your answer to two decimal places. '+' '+'\n'+'_____________________'+'\n'break;case 7:x=Math.round(eval(Math.random()*18+2)*1)/1y=Math.round(eval(Math.random()*98+2)*1)/1obj.result.value+='Problem 7:\r('+x+'x-20)'+y+'=0, what is x to three decimal places?'+'\n'+'_____________________'+'\n'break;case 8:x=Math.round(eval(Math.random()*9+3)*1)/1y=Math.round(eval(Math.random()*11+9)*1)/1obj.result.value+='Problem 8:'+'\r'+x+'x+4y=2 '+'\r'+' 6x+'+y+'y=4 '+'\r'+' What is x to three decimal places? '+'\r'+' What is y to three decimal places?'+'\n'+'_____________________'+'\n'break;case 9:x=Math.round(eval(Math.random()*12+2)*1)/1y=Math.round(eval(Math.random()*12+2)*1)/1obj.result.value+='Problem 9:\r '+'\r'+' 2x+4y='+x+' '+'\r'+' x+6y='+y+' '+'\r'+' What is y to 3 decimal places? '+'\r'+' What is x to three decimal places?'+'\n'+'_____________________'+'\n'break;case 10:x=Math.round(eval(Math.random()*5+2)*10)/10y=Math.round(eval(Math.random()*7+4)*10)/10obj.result.value+='Problem 10:\r'+x+'x^2+'+y+'x=0, one root of this equation is zero, to 3 decimal places what is the other root?'+'\n'+'_____________________'+'\n'break;//qqq2default:alert("not authored ")break;}JJ=0}}function fit(obj){gradeOA=parseFloat(0)for(i=0;i<grade.length;i++){gradeOA+=parseFloat(grade[i])}gradeOA=eval(gradeOA/nump)document.forms[1].results.value+="\n"+document.forms[0].result.valuedocument.forms[0].result.value="Your Grade for this exercise is "+gradeOAdocument.forms[1].results.value+="\n"+document.forms[0].result.valueif(document.forms[1].send_to.value!=""&&document.forms[1].email.value!=""){document.forms[1].send_to.value=document.forms[1].email.value+","+document.forms[1].send_to.valuedocument.forms[1].subject.value='Math 101'document.forms[1].action='http://image-ination.com/cgi-bin/form.pl'return true}else{return false}}function setFocus() {        document.evalform2.result.focus();        return;}function compute(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])   obj.result.value +="\r"+eval(ss)}function compute2e(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])   obj.result.value +="\r"+"{"+eval(ss)+"}"+"\r"}function compute3(obj) {obj.temp.value=obj.result.value var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])var nn=prompt("What power","enter here")   obj.result.value += "\r"+"^3"+"\r"+eval(Math.pow(parseFloat(ss),nn))}function compute2(obj) {obj.temp.value=obj.result.value var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])   obj.result.value +="\r"+"^2"+"\r"+ eval(Math.pow(parseFloat(ss),2))}function computem(obj) { var  sd = obj.result.value.split("\r") var  ss = sd[sd.length-1]obj.memory.value=ssobj.result.value+="\r"+"mem->"+"\r"}function computemp(obj) { var  sd = obj.result.value.split("\r") var  ss = sd[sd.length-1]   obj.memory.value =eval(parseFloat(obj.memory.value)+parseFloat(ss))obj.result.value+="\r"+"mem+"+"\r"}function computemr(obj) {obj.temp.value=obj.result.value   obj.result.value+= obj.memory.value}function computesq(obj) {obj.temp.value=obj.result.value var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])   obj.result.value += "\r"+"sqrt"+"\r"+eval(Math.pow(parseFloat(ss),.5))}function computesi(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value += "\r"+"sin"+"\r"+eval(Math.sin(ss*ch))}function computeas(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value += "\r"+"asin"+"\r"+eval(Math.asin(ss)/ch)}function computeco(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value += "\r"+"cos"+"\r"+eval(Math.cos(ss*ch))}function git(obj,obj2){obj2=parseFloat(obj2)var b=new Array()switch(obj2){case 1:a[0]=(parseFloat([x])+parseFloat([y]))*parseFloat([z]);b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='This is  the same as x*z+y*z 'a[1]=parseFloat([x])+parseFloat([y])*parseFloat([z]);b[1]=obj.result.value.split('{')[2].split('}')[0]c[1]=' This is not the same as (x+y)*z 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[0]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[0]+'\r'+'\r'break;case 2:g=0a[0]=(parseFloat([x])+parseFloat([y]))*parseFloat([z]);b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='This is  the same as (x+y)*z 'a[1]=(parseFloat([x])+parseFloat([y]))*parseFloat([z]);b[1]=obj.result.value.split('{')[2].split('}')[0]c[1]=' This is  the same as (x+y)*z 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[1]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[1]+'\r'+'\r'break;case 3:g=0;a[0]=Math.round(((parseFloat([z])-parseFloat([y]))/parseFloat([x]))*100)/100;b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]=' 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[2]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[2]+'\r'+'\r'break;case 4:g=0a[0]=Math.round(eval((5)/(parseFloat([x])-parseFloat([y])))*10000)/10000;;b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='Group the terms containing x on the left and the other numbers on the right. 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[3]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[3]+'\r'+'\r'break;case 5:g=0a[0]=Math.round(eval((parseFloat([y])*8-4)/(parseFloat([x])-2*parseFloat([y])))*1000)/1000;;b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='Multiply both sides by the denominator and then group terms containing x on the left. 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[4]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[4]+'\r'+'\r'break;case 6:g=0a[0]=Math.round(eval((parseFloat([y])-parseFloat([x])+4)/4)*100)/100;;b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='Group all the numbers on the right and then divide by 4. 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[5]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[5]+'\r'+'\r'break;case 7:g=0a[0]=Math.round(eval(20/parseFloat([x]))*1000)/1000;;b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='Zero divided by any non zero number is still zero. 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[6]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[6]+'\r'+'\r'break;case 8:g=0a[0]=Math.round(eval((parseFloat([y])*2-16)/(parseFloat([x])*parseFloat([y])-24))*1000)/1000;;b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='Multiply the first equation by the number in front of y in the second equation. Multiply the second equation by the number in front of y in the first equation.Subtract! Solve for x. 'a[1]=Math.round(eval((12-4*parseFloat([x]))/(24-parseFloat([x])*parseFloat([y])))*1000)/1000;;b[1]=obj.result.value.split('{')[2].split('}')[0]c[1]=' Substitute your result from part 1 into either equation. 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[7]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[7]+'\r'+'\r'break;case 9:g=0a[0]=Math.round(eval((parseFloat([y])*2-parseFloat([x]))/8)*1000)/1000;;b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='Solve for x in the first equation and substitute your result in the second equation.Find y from this. 'a[1]=Math.round(eval((3*parseFloat([x])-2*parseFloat([y]))/4)*1000)/1000;;b[1]=obj.result.value.split('{')[2].split('}')[0]c[1]=' Substitute y in either equation. 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[8]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[8]+'\r'+'\r'break;case 10:g=0a[0]=Math.round(eval(-parseFloat([y])/parseFloat([x]))*1000)/1000;;b[0]=obj.result.value.split('{')[1].split('}')[0]c[0]='Divide both terms by x and solve for the one remaining x. 'for(j=0;j<b.length;j++){if(Math.abs(parseFloat(a[j])-parseFloat(b[j]))<.01*Math.abs(parseFloat(a[j]))){g+=parseFloat(1);obj.result.value=obj.result.value.replace(/}\s/,'}_correct\r')}else{g+=parseFloat(0);obj.result.value=obj.result.value.replace(/}\s/,'}_wrong\r'+c[j]+'\r'+'The correct answer is '+a[j]+'\r'+'__________'+'\r')}}grade[9]=(g/(b.length))*100;obj.result.value+='\r'+'Your grade on this problem is: '+grade[9]+'\r'+'\r'break;//qqq5default:alert("not authored")break;}}function computeac(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value +="\r"+"acos"+"\r"+eval(Math.acos(ss)/ch)}function computeta(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value += "\r"+"tan"+"\r"+eval(Math.tan(ss*ch))}function computeat(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value += "\r"+"atan"+"\r"+eval(Math.atan(ss)/ch)}function computeex(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value += "\r"+"exp"+"\r"+eval(Math.exp(parseFloat(ss)))}function computelo(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value += "\r"+"ln"+"\r"+eval(Math.log(parseFloat(ss)))}function computelog(obj) { var  sd = obj.result.value.split("\r") var  ss = eval(sd[sd.length-1])obj.temp.value=obj.result.value   obj.result.value += "\r"+"log"+"\r"+eval(.434294482*Math.log(parseFloat(ss)))}function computepi(obj) {obj.temp.value=obj.result.value   obj.result.value += eval(Math.PI)}function computecl(obj) {   obj.result.value = obj.temp.value}function computemc(obj) {   obj.result.value += "\r"}function compute0(obj) {obj.temp.value=obj.result.value   obj.result.value += 0}function compute1(obj) {obj.temp.value=obj.result.value   obj.result.value += 1}function computen2(obj) {obj.temp.value=obj.result.value   obj.result.value += 2}function computen3(obj) {obj.temp.value=obj.result.value   obj.result.value += 3}function compute4(obj) {obj.temp.value=obj.result.value   obj.result.value += 4}function compute5(obj) {obj.temp.value=obj.result.value   obj.result.value += 5}function compute6(obj) {obj.temp.value=obj.result.value   obj.result.value += 6}function compute7(obj) {obj.temp.value=obj.result.value   obj.result.value += 7}function compute8(obj) {obj.temp.value=obj.result.value   obj.result.value += 8}function compute9(obj) {obj.temp.value=obj.result.value   obj.result.value += 9}function computeper(obj) {obj.temp.value=obj.result.value   obj.result.value += "."}function computee(obj) {obj.temp.value=obj.result.value   obj.result.value += "e"}function computeleft(obj) {obj.temp.value=obj.result.value   obj.result.value += "("}function computeright(obj) {obj.temp.value=obj.result.value   obj.result.value += ")"}function computeplu(obj) {obj.temp.value=obj.result.value   obj.result.value += "+"}function computemin(obj) {obj.temp.value=obj.result.value   obj.result.value += "-"}function computemul(obj) {obj.temp.value=obj.result.value   obj.result.value += "*"}function computediv(obj) {obj.temp.value=obj.result.value   obj.result.value += "/"}function computeInsert(obj){document.forms[0].temp.value=document.forms[0].result.valuevar ins=prompt("What is your comment?","enter here")document.forms[0].result.value+="\r"+"--------"+"\r"+ins+"\r"+"--------"+"\r"}function computecall(obj){if(confirm("Are you sure you want to clear the whole record?\nIt is 'undoable' using the clear key if you change your mind.")){obj.temp.value=obj.result.valueobj.result.value=" "}}