{VERSION 6 0 "IBM INTEL NT" "6.0" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 1 12 255 0 0 1 2 1 2 2 1 2 0 0 0 1 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "Courier" 1 12 0 0 0 1 2 2 2 2 2 2 1 1 1 1 }1 1 0 0 0 0 2 0 2 0 2 2 0 1 }} {SECT 0 {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 8 "restart:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 89 "with(Maplets): with(Maplets[Tools]) : with(Maplets[Elements]): with(plots):\nStartEngine();" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "randomize():" }}}{EXCHG {PARA 0 "> \+ " 0 "" {MPLTEXT 1 0 1552 "DomainFinder:=Maplet(onstartup = RunWindow(M AIN),\nWindow[MAIN]('title'=\"Domain Finder for Square Root Functions \",\n [ halign=none,\n [ Button(\"New Function\", Evaluate('functi on' = \"ask\")),\n HorizontalGlue(),\n Button(\"Quit\", Shut down())\n ],\n [ \"What is the domain of the following function? \",\n HorizontalGlue()\n ],\n [ MathMLViewer['function']('w idth'=300,'height'=60 )\n ],\n [ HorizontalGlue(),\n [ Radi oButton['RBleftparen'](\"(\", 'value'=false, 'group'='BGleft'),\n \+ RadioButton['RBleftbrack'](\"[\", 'value'=false, 'group'='BGleft') \n ], \n TextField['intervalleft']('width'=15),\n \",\" ,\n TextField['intervalright']('width'=15),\n [ RadioButton[ 'RBrightparen'](\")\", 'value'=false, 'group'='BGright'),\n Rad ioButton['RBrightbrack'](\"]\", 'value'=false, 'group'='BGright')\n \+ ],\n HorizontalGlue()\n ],\n [ HorizontalGlue(),\n \+ Button(\"Check Answer\", Evaluate('function' = \"check\")),\n Hor izontalGlue(),\n Button(\"Show Answer\", Evaluate('function'=\"sh ow\")),\n Button(\"Plot It\", onclick=A1),\n HorizontalGlue( )\n ],\n [ \"Comment:\",TextBox['reply']('width'=60, height=2, ' editable'='false')\n ],\n [\"Programmers: Hammer & Peters Copyr ight P. Yasskin 2005\"\n ]\n ]\n),\nWindow[PlotIt]('title'=\"The P lot\",\n [ Plotter['myplot'](plot(0, x=-10..10, y=0..5),'width'=300, \+ 'height'=300),\n Button(\"Good Bye\", CloseWindow(PlotIt))\n ]\n), \nAction[A1](RunWindow(PlotIt), Evaluate('function' = \"plotfunc\")), \nButtonGroup['BGleft'](),\nButtonGroup['BGright']()\n):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 12 "First:=true:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "vrange:=0..5:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 55 "card :=rand(0..1):\nrand8:=rand(1..8):\nrand3:=rand(1..3):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1104 "ask:=proc()\nlocal a,b,funcs;\nglobal card,rand8,ra nd3,n, leftb, rightb, intleft, intright, f,x, vrange, First;\na:=(-1)^ card()*rand8();\nb:=(-1)^card()*rand8();\nSet('reply'=\"\");\nSet('RBl eftparen'=false);\nSet('RBleftbrack'=false);\nSet('RBrightparen'=false );\nSet('RBleftbrack'=false);\nSet('intervalleft'=\"\");\nSet('interva lright'=\"\");\nif not First then Set('myplot'=plot(0, x=-10..10, y=0. .5)) end if;\nfuncs:=[sqrt(a*x+b),1/sqrt(a*x+b),sqrt(a/(x-b))];\nn:=ra nd3();\nf:=funcs[n];\nSet('function'=MathML[Export]('f(x)'=f));\nif a> 0 and n=1 then leftb:=0; rightb:=1; intleft:=-b/a; intright:=infinity ; vrange:=0..5 end if;\nif a<0 and n=1 then leftb:=1; rightb:=0; intle ft:=-infinity; intright:=-b/a; vrange:=0..5 end if;\nif a>0 and n=2 th en leftb:=1; rightb:=1; intleft:=-b/a; intright:=infinity; vrange:=0.. 5 end if;\nif a<0 and n=2 then leftb:=1; rightb:=1; intleft:=-infinity ; intright:= b/a; vrange:=0..5 end if;\nif a>0 and n=3 then leftb:=1; \+ rightb:=1; intleft:=b; intright:= infinity; vrange:=0..5 end if;\nif a <0 and n=3 then leftb:=1; rightb:=1; intleft:=-infinity; intright:= b; vrange:=0..5 end if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 1216 "check :=proc()\nglobal leftb, rightb, intleft, intright;\nlocal userleftpare n, userleftbrack, userintervalleft, userintervalright, userrightparen, userrightbrack, userleftb, userrightb; \n\nuserleftparen:=Get('RBleft paren'::truefalse);\nuserleftbrack:=Get('RBleftbrack'::truefalse);\n\n userintervalleft:=Get('intervalleft'::anything, corrections=true, upda te=true);\nuserintervalright:=Get('intervalright'::anything, correctio ns=true, update=true);\n\nuserrightparen:=Get('RBrightparen'::truefals e);\nuserrightbrack:=Get('RBrightbrack'::truefalse);\n\nif (not userle ftparen and not userleftbrack) or (not userrightparen and not userrigh tbrack) then\n Set('reply'=\"You must select a left and right parenth esis or bracket. Then check again.\");\n return\nend if;\n \nif userl eftparen then userleftb:=1 else userleftb:=0 end if; \nif userrightpar en then userrightb:=1 else userrightb:=0 end if;\n \nif userleftb-left b=0 and userrightb-rightb=0 and userintervalleft=intleft and userinter valright=intright then\n Set('reply'=\"Correct! Good Job!\")\nelif no t userleftb-leftb=0 or not userrightb-rightb=0 then\n Set('reply'=\"In correct. Check your parentheses and brackets.\")\nelse \n Set('reply'= \"Incorrect. Check your endpoints.\")\nend if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 272 "show:=proc()\nglobal leftb, rightb, intleft, intrigh t;\nSet('intervalleft'=intleft);\nSet('intervalright'=intright);\nif l eftb=0 then Set(RBleftbrack=true) else Set(RBleftparen=true) end if;\n if rightb=0 then Set(RBrightbrack=true) else Set(RBrightparen=true) en d if;\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}} {EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 127 "plotfunc:=proc()\nlocal p1 ;\nglobal f, vrange, First;\nFirst:=false;\np1:=plot(f, x=-10..10, y=v range);\nSet('myplot'=p1)\nend proc:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "Display (DomainFinder);" }}}}{MARK "0 0 0" 0 }{VIEWOPTS 1 1 0 1 1 1803 1 1 1 1 }{PAGENUMBERS 0 1 2 33 1 1 }