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=5msg=open("ins.html","msg","width=400,height=400,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()*80+5)*1)/1;y=Math.round(eval(Math.random()*75+10)*1)/1;//document.images[0].src="ins.gif"obj.result.value+="Problem 1: Vector A has magnitude "+ x +" units and direction, counterclockwise from east, of  "+y+" degrees, what is the value of its x-component to 1 decimal place? What is its y-component?"+"\n"+"_____________________"+"\n"break;case 2:x=Math.round(eval(Math.random()*20+-10)*10)/10;y=Math.round(eval(Math.random()*10+0)*10)/10;//document.images[0].src="ins.gif"obj.result.value+="Problem 2: A vector has x-component "+x+" and y-component "+y+", what is its magnitude to the nearest tenth of a unit ? What is its direction to the nearest tenth of a degree? "+"\n"+"_____________________"+"\n";break;case 3:x=Math.round(eval(Math.random()*7+1)*10)/10;y=Math.round(eval(Math.random()*90+0)*1)/1;//document.images[0].src="ins.gif"obj.result.value+="Problem 3: Vector A is 10 units long and is at angle of "+y+" degrees counterclockwise  from east . Vector B is of length 10 units and is at an angle of -30 degrees. What is the direction to the nearest tenth of a degree measured counterclockwise from east of A+"+x+"B ? What is its magnitude to the nearest tenth of a unit?"+"\n"+"_____________________"+"\n"break;case 4:x=Math.round(eval(Math.random()*12+4)*10)/10;y=Math.round(eval(Math.random()*12+4)*10)/10;//z=Math.round(eval(Math.random()*12+4)*10)/10;//document.images[0].src="ins.gif" obj.result.value+="Problem 4: A car traveling at "+x+" m/s northwest reaches a curve and "+y+" seconds later it is heading north at 15 m/s, what is the magnitude of its average acceleration to 2 decimal places? What is the direction of the average acceleration measured counterclockwise from east to the nearest tenth of a degree?"+"\n"+"_____________________"+"\n"break;case 5:x=Math.round(eval(Math.random()*5+3)*10)/10;y=Math.round(eval(Math.random()*180+0));msg.document.images[0].src="boat2.gif"msg.focus() obj.result.value+="Problem 5: A boat is traveling with a speed "+x+" mph over the water and at a direction of "+y+" degrees counterclockwise from east. The river itself is flowing east at 4 mph relative to its bank. What is the speed of the boat relative to the river bank to the nearest hundredth of a mph ? What is the angle of progress of the boat with respect to the river bank to the nearest tenth of a degree?"+"\n"+"_____________________"+"\n"break;case 6:alert("not authored yet")break;case 7:alert("not authored yet")break;case 8:alert("not authored yet")break;case 9:alert("not authored yet")break;case 10:alert("not authored yet")break;default:alert("not authored yet")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"+obj.result.valueobj.result.value="Your Grade for this exercise is "+gradeOAdocument.forms[1].results.value+="\n"+obj.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='Chapter_3'document.forms[1].action='http://image-ination.com/cgi-bin/form.pl'document.forms[1].submit()}}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://alert(nn)g=0a[0]=Math.round(eval(eval(Math.cos(parseFloat(y)*Math.PI/180))*parseFloat(x))*10)/10;a[1]=Math.round(eval(eval(Math.sin(parseFloat(y)*Math.PI/180))*parseFloat(x))*10)/10;//alert(x+"  "+y+"  "+a1[0]+"  "+a1[1])b[0]=obj.result.value.split("{")[1].split("}")[0]b[1]=obj.result.value.split("{")[2].split("}")[0]c[0]="(Did you use the cosine function? See Problem Solving Note on page 56 in Walker.)"c[1]="(Did you use the sine function? See Problem Solving Note on page 56 in Walker.)"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"//alert(grade)break;case 2:g=0a[0]=Math.round(eval(Math.sqrt(parseFloat((eval(Math.pow(parseFloat(parseFloat(x)),2)))+(eval(Math.pow(parseFloat(parseFloat(y)),2))))))*10)/10;if(x<0){a[1]=Math.round((eval(Math.atan((parseFloat(y))/(parseFloat(x)))/(Math.PI/180))+180)*10)/10}else{a[1]=Math.round(eval(Math.atan((parseFloat(y))/(parseFloat(x)))/(Math.PI/180))*10)/10};b[0]=obj.result.value.split("{")[1].split("}")[0]b[1]=obj.result.value.split("{")[2].split("}")[0]c[0]="(Did you  remember to use the sqrt function? See section 3-2 in Walker.)"c[1]="(Did you use the inverse tangent function? If the result was negative you have to adjust it to the apporpriate quadrant. See section 3-2 in Walker.)"for(j=0;j<b.length;j++){//alert(a[j]+"   "+b[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"//alert(grade)break;case 3:g=0if(x>2*Math.sin(y*.0174533)){a[0]=Math.round(eval(eval(Math.atan((eval(Math.sin(parseFloat(y)*Math.PI/180))*10-parseFloat(x)*5)/(eval(Math.cos(parseFloat(y)*Math.PI/180))*10+parseFloat(x)*8.6666666667))/(Math.PI/180))+360)*10)/10}else{a[0]=Math.round(eval(eval(Math.atan((eval(Math.sin(parseFloat(y)*Math.PI/180))*10-parseFloat(x)*5)/(eval(Math.cos(parseFloat(y)*Math.PI/180))*10+parseFloat(x)*8.666666667))/(Math.PI/180)))*10)/10};a[1]=Math.round(eval(eval(Math.sqrt(parseFloat((eval(Math.pow(parseFloat((eval(Math.cos(parseFloat(y)*Math.PI/180))*10)+(parseFloat(x)*8.666666667)),2)))+(eval(Math.pow(parseFloat(eval(Math.sin(parseFloat(y)*Math.PI/180))*10-5*parseFloat(x)),2)))))))*10)/10b[0]=obj.result.value.split("{")[1].split("}")[0]b[1]=obj.result.value.split("{")[2].split("}")[0]c[0]="(If the answer was negative you need to add 360 to express it properly. See 'Adding Vectors' on page 61 in Walker.)"c[1]="(Did you use the squareroot function? See 'Adding Vectors' on page 61 in Walker.)"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"//alert(grade)break;case 4:g=0a[0]=Math.round(eval(eval(Math.sqrt(parseFloat((eval(Math.pow(parseFloat(parseFloat(x)*.707070707/parseFloat(y)),2)))+(eval(Math.pow(parseFloat((15-parseFloat(x)*.707070707)/parseFloat(y)),2)))))))*100)/100;a[1]=Math.round(eval(eval(Math.atan(eval((15-parseFloat(x)*.707070707)/(.707070707*parseFloat(x))))/(Math.PI/180)))*10)/10;//alert(a[0]+"   "+a[1])b[0]=obj.result.value.split("{")[1].split("}")[0]b[1]=obj.result.value.split("{")[2].split("}")[0]c[0]="(See Active Example 3-2 on page 67 in Walker.)"c[1]="(See Active Example 3-2 on page 67 in Walker. Use the atan(Vy/Vx))"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"//alert(grade)break;case 5:g=0a[0]=Math.round(eval(eval(Math.sqrt(parseFloat((eval(Math.pow(parseFloat((parseFloat(x))*(eval(Math.cos(parseFloat(y)*Math.PI/180)))+4),2)))+(eval(Math.pow(parseFloat(eval(Math.sin(parseFloat(y)*Math.PI/180))*parseFloat(x)),2)))))))*100)/100;if(x*Math.cos(y*Math.PI/180)<-4){a[1]=(Math.round(eval(eval(Math.atan(((parseFloat(x))*(eval(Math.sin(parseFloat(y)*Math.PI/180))))/(eval(Math.cos(parseFloat(y)*Math.PI/180))*parseFloat(x)+4))/(Math.PI/180)))*10)/10)+180}else{a[1]=Math.round(eval(eval(Math.atan(((parseFloat(x))*(eval(Math.sin(parseFloat(y)*Math.PI/180))))/(eval(Math.cos(parseFloat(y)*Math.PI/180))*parseFloat(x)+4))/(Math.PI/180)))*10)/10};b[0]=obj.result.value.split("{")[1].split("}")[0]b[1]=obj.result.value.split("{")[2].split("}")[0]c[0]="(See Exercise 3-2 on page 70 in Walker.)"c[1]="(See Exercise 3-2 on page 70 in Walker.)"//alert(a[0]+"   "+a[1])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"//alert(grade)break;case 6:alert("not authored yet")break;default:alert("&&")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){obj.temp.value=obj.result.valuevar ins=prompt("What is your comment?","enter here")obj.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=" "}}