{VERSION 5 0 "IBM INTEL NT" "5.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Times" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 1 0 1 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "" 0 "" {TEXT -1 17 "Mustafa Tongarlak" }} {PARA 0 "" 0 "" {TEXT -1 19 "Ibrahim Pekkucuksen" }{MPLTEXT 1 0 0 "" } }{PARA 0 "" 0 "" {TEXT -1 12 "Math 253-201" }}{PARA 0 "" 0 "" {TEXT -1 14 "Maplet Project" }}{PARA 0 "" 0 "" {TEXT -1 29 "\"Distance Betwe en Two Points\"" }{MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 74 "with(Maplets): with(Maplets[Tools]): with(Maplets[Elements]): with(pl ots):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 14 "StartEngine();" }} }{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1591 "Distance:= Maplet('onstar tup' = RunWindow(MAIN),\n Window['MAIN']('title'=\"Distance Between T wo Points.\",\n [ [ Button(\"Help\", RunWindow('help')),\n \+ \" \",\n Button(\"Initialize\", Evaluate(function=\"initial ize\")),\n \" \",\n Button(\"Quit\", Shutdown())\n \+ ], \n [ TextField['question']('width'=30, 'editable'='fals e')\n ],\n [ \"Distance = \", TextField['answer']('width'=10 ),\n Button(\"Check Answer\", Evaluate(function=\"check\"))\n \+ ],\n [ TextField['reply']('width'=10, 'editable'='false'), \n Button(\"Show Answer\", Evaluate(function=\"show\"))\n ], \n [ Button(\"Easy\", Evaluate(function=\"easyask\")),\n \+ \" \",\n Button(\"Normal\", Evaluate(function=\"ask\")), \n \" \",\n Button(\"Hard\", Evaluate(function=\"h ardask\"))\n ],\n [ \"Correct Answers:\",\n TextField ['correct']('width'=4, 'editable'='false'),\n \" \",\n \+ \"Number of trials:\",\n TextField['questions']('width'=4, 'edi table'='false'),\n \" \",\n \"Success:\",\n Text Field['percentage']('width'=4, 'editable'='false'),\n \"%\"\n \+ ] \n ]\n ),\n Window['help']('title' = \"Help!\",\n [ [ \+ \"This Maplet should help improve your ability to do simple algebraic \+ calculations.\"\n ],\n [ \"The distance between the points ( x1,y1) and (x2,y2) is\"\n ],\n [ TextField['needhelp'](\" s qrt( (x2-x1)^2 + (y2-y1)^2 )\", 'width'=25, 'editable'='false'),\n \+ Button(\"Quit Help\", CloseWindow('help'))\n ],\n [ \"No te: If sqrt( ) won't work, try ( )^(1/2).\"\n ]\n ]\n )\n): " }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 566 "initialize:=proc()\ngl obal correctanswer, numberofcorrect, numberofquestions;\nlocal a,b,c,d , p1, p2, rand5;\nnumberofcorrect:=0;\nnumberofquestions:=0;\nSet('que stions'=numberofquestions);\nSet('correct'=numberofcorrect);\nSet('per centage'=0);\nrand5:=rand(-5..5);\na:=rand5();\nb:=rand5();\nc:=rand5( );\nd:=rand5();\ncorrectanswer:=sqrt((d-b)^2+(c-a)^2);\np1:=substring( convert([a,b],string),2..-2);\np2:=substring(convert([c,d],string),2.. -2);\nSet('question'=cat(\"Find the distance between the two points ( \", p1, \") and (\",p2,\").\"));\nSet('answer'=\"\");\nSet('reply'=\" \");\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 498 "ask:=pr oc()\nglobal correctanswer, numberofcorrect, numberofquestions;\nlocal a,b,c,d, p1, p2, rand7, rannum;\nrannum:=[-7,-6,-5,-4,4,5,6,7];\nrand 7:=rand(1..8);\na:=rannum[rand7()];\nb:=rannum[rand7()];\nc:=rannum[ra nd7()];\nd:=rannum[rand7()];\ncorrectanswer:=sqrt((d-b)^2+(c-a)^2);\np 1:=substring(convert([a,b],string),2..-2);\np2:=substring(convert([c,d ],string),2..-2);\nSet('question'=cat(\"Find the distance between the \+ two points (\", p1, \") and (\",p2,\").\"));\nSet('answer'=\"\");\nSet ('reply'=\"\");\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 432 "easyask:=proc()\nglobal correctanswer, numberofcorrect, numberofq uestions;\nlocal a,b,c,d, p1, p2, rand4;\nrand4:=rand(-4..4);\na:=rand 4();\nb:=rand4();\nc:=rand4();\nd:=rand4();\ncorrectanswer:=sqrt((d-b) ^2+(c-a)^2);\np1:=substring(convert([a,b],string),2..-2);\np2:=substri ng(convert([c,d],string),2..-2);\nSet('question'=cat(\"Find the distan ce between the two points (\", p1, \") and (\",p2,\").\"));\nSet('answ er'=\"\");\nSet('reply'=\"\");\nend proc:" }}}{EXCHG {PARA 0 "> " 0 " " {MPLTEXT 1 0 534 "hardask:=proc()\nglobal correctanswer, numberofcor rect, numberofquestions;\nlocal a,b,c,d, p1, p2, rand14, rannum;\nrann um:=[-14,-13,-12,-11,-10,-9,-8,8,9,10,11,12,13,14];\nrand14:=rand(1..1 4);\na:=rannum[rand14()];\nb:=rannum[rand14()];\nc:=rannum[rand14()]; \nd:=rannum[rand14()];\ncorrectanswer:=sqrt((d-b)^2+(c-a)^2);\np1:=sub string(convert([a,b],string),2..-2);\np2:=substring(convert([c,d],stri ng),2..-2);\nSet('question'=cat(\"Find the distance between the two po ints (\", p1, \") and (\",p2,\").\"));\nSet('answer'=\"\");\nSet('repl y'=\"\");\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 606 "ch eck:=proc()\nglobal numberofquestions, numberofcorrect, correctanswer; \nlocal userdistance, a, rand5, percent, per;\nrand5:=rand(0..1);\na:= rand5();\nuserdistance:=Get(thismaplet, 'answer'::'realcons'):\nif sim plify(userdistance/correctanswer,symbolic)=1\n then Set('reply'=\"Cor rect! Try another question.\");\n numberofcorrect:=numberofcorrec t+1;\n else Set('reply'=\"Incorrect! Try again.\")\nend if;\nSet( 'correct'=numberofcorrect);\nnumberofquestions:=numberofquestions+1;\n Set('questions'=numberofquestions);\npercent:=round(100 * (numberofcor rect/numberofquestions));\nSet('percentage'=percent);\nend proc:" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "show:=proc()\nglobal correct answer;\nSet('answer'=correctanswer)\nend proc:" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 18 "Display(Distance);" }}}{EXCHG }{EXCHG }{EXCHG }{EXCHG }}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 1 1 1 1803 1 1 1 1 } {PAGENUMBERS 0 1 2 33 1 1 }