<?xml version="1.0" encoding="UTF-8"?>
<Worksheet>
<Version major="7" minor="1"/>
<Label-Scheme value="2" prefix=""/>
<View-Properties presentation="false"></View-Properties>
<MapleNet-Properties warnlevel="3" longdelim="true" plotoptions="" echo="1" errorcursor="false" elisiontermsthreshold="10000" elisiontermsbefore="100" errorbreak="1" prettyprint="3" prompt="&gt; " latexwidth="6.0" useclientjvm="true" ansi="false" screenheight="25" labelwidth="20" plotdevice="inline" typesetting="standard" displayprecision="-1" indentamount="4" elisiondigitsthreshold="10000" quiet="false" plotoutput="terminal" rtablesize="10" preplot="" showassumed="0" plotdriver="openviz" elisiontermsafter="100" labelling="true" postplot="" screenwidth="79" elisiondigitsbefore="100" elisiondigitsafter="100" verboseproc="1" imaginaryunit="I" ShowLabels="true"/>
<Styles><Font name="Heading 4" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Ordered List 5" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Ordered List 1" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Text Output" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Bullet Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Equation Label" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Author" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Diagnostic" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[40,120,40]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Heading 2" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="16" subscript="false" superscript="false" underline="false"/>
<Font name="Page Number" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="10" subscript="false" superscript="false" underline="false"/>
<Font name="Ordered List 3" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Maple Plot" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Normal" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Maple Input" background="[255,255,255]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Annotation Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false"/>
<Font name="2D Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="2D Inert Output" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[144,144,144]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Dictionary Hyperlink" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[147,0,15]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true"/>
<Font name="Dash Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Heading 3" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="true" opaque="false" readonly="false" size="14" subscript="false" superscript="false" underline="false"/>
<Font name="Ordered List 4" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Maple Output" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="List Item" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="2D Input" background="[255,255,255]" bold="false" executable="true" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Line Printed Output" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Maple Input Placeholder" background="[255,255,255]" bold="true" executable="true" family="Monospaced" foreground="[200,0,200]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="2D Math" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Error" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[255,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Warning" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[0,0,255]" italic="false" opaque="false" readonly="true" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Heading 1" background="[255,255,255]" bold="true" executable="false" family="Serif" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false"/>
<Font name="Annotation Text" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Title" background="[255,255,255]" bold="true" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="18" subscript="false" superscript="false" underline="false"/>
<Font name="Ordered List 2" background="[255,255,255]" bold="false" executable="false" family="Times New Roman" foreground="[0,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false"/>
<Font name="Hyperlink" background="[255,255,255]" bold="false" executable="false" family="Serif" foreground="[0,128,128]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="true"/>
<Layout name="Ordered List 5" alignment="left" bullet="ROMAN" firstindent="0" leftmargin="144" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1"/>
<Layout name="Heading 4" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Text Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="newline" pagebreak-before="false" initial="0"/>
<Layout name="Ordered List 1" alignment="left" bullet="numeric" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1"/>
<Layout name="Annotation Title" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="12" spacebelow="12" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Bullet Item" alignment="left" bullet="dot" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Author" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="8" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Dash Item" alignment="left" bullet="dash" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Heading 3" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Diagnostic" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="any" pagebreak-before="false" initial="0"/>
<Layout name="Ordered List 4" alignment="left" bullet="ALPHABETIC" firstindent="0" leftmargin="108" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1"/>
<Layout name="Maple Output" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.3" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Line Printed Output" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="any" pagebreak-before="false" initial="0"/>
<Layout name="List Item" alignment="left" bullet="indent" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Heading 2" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="2" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Ordered List 3" alignment="left" bullet="roman" firstindent="0" leftmargin="72" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1"/>
<Layout name="Error" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Maple Plot" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Warning" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Heading 1" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="8" spacebelow="4" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Title" alignment="centred" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="12" spacebelow="12" linebreak="space" pagebreak-before="false" initial="0"/>
<Layout name="Ordered List 2" alignment="left" bullet="alphabetic" firstindent="0" leftmargin="36" rightmargin="0" linespacing="0.0" spaceabove="3" spacebelow="3" linebreak="space" pagebreak-before="false" initial="-1"/>
<Layout name="Normal" alignment="left" bullet="none" firstindent="0" leftmargin="0" rightmargin="0" linespacing="0.0" spaceabove="0" spacebelow="0" linebreak="space" pagebreak-before="false" initial="0"/>
<Pencil-style name="Pencil 3" pen-color="[0,0,0]" pen-height="3.0" pen-width="3.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 1" pen-color="[0,0,0]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 5" pen-color="[255,0,0]" pen-height="5.0" pen-width="5.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 2" pen-color="[0,0,255]" pen-height="1.0" pen-width="1.0" pen-opacity="1.0"/>
<Pencil-style name="Pencil 4" pen-color="[0,0,255]" pen-height="3.0" pen-width="3.0" pen-opacity="1.0"/>
<Highlighter-style name="Highlighter 2" pen-color="[255,204,0]" pen-height="14.0" pen-width="14.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 4" pen-color="[0,255,255]" pen-height="32.0" pen-width="32.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 3" pen-color="[51,255,0]" pen-height="24.0" pen-width="24.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 1" pen-color="[255,153,255]" pen-height="12.0" pen-width="8.0" pen-opacity="0.8"/>
<Highlighter-style name="Highlighter 5" pen-color="[255,255,0]" pen-height="48.0" pen-width="48.0" pen-opacity="0.8"/>
</Styles>
<Task-table>
    <Task-category name="&lt;default&gt;">
    </Task-category>
</Task-table>
<Group labelreference="L4" drawlabel="true">
<Input>
<Text-field style="Text" layout="Normal">Center of Mass of a Plate</Text-field>
<Text-field style="Text" layout="Normal">Sarah Mannen and Talha Ramzan</Text-field>
</Input>
</Group>
<Group labelreference="L1" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;</Text-field>
</Input>
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">with(Maplets[Tools]): with(Maplets[Elements]): with(plots): with(RandomTools):</Text-field>
</Input>
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">StartEngine();</Text-field>
</Input>
</Group>
<Group labelreference="L28" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">randomize():</Text-field>
</Input>
</Group>
<Group labelreference="L5" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">lightorange:=&quot;#FFB300&quot;:</Text-field>
</Input>
</Group>
<Group labelreference="L30" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">randx1:=rand(0..2):
randx2:=rand(4..6):</Text-field>
</Input>
</Group>
<Group labelreference="L8" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">ask:=proc()
global f, g, x1, x2, pad, M, Mval, My, Myval, Mx, Mxval, X, Y, p1, p2, p3, p4;
local fmin, gmax, dy;
f:=sort(Generate(polynom(integer(range=-3..3), x, degree=2)));
g:=sort(Generate(polynom(integer(range=-3..3), x, degree=2)));
x1:=randx1();
x2:=randx2();
fmin:=minimize(f, x=x1..x2);
gmax:=maximize(g, x=x1..x2);
dy:=fmin-gmax;
if dy&lt;0 then
  f:=f-dy;
end if;
M:=Int(f-g,x=x1..x2);
Mval:=value(M);
My:=Int(x*(f-g),x=x1..x2);
Myval:=value(My);
Mx:=1/2*Int(f^2-g^2,x=x1..x2);
Mxval:=value(Mx);
X:=value(My/M);
Y:=value(Mx/M);
Set(question=cat(&quot;Find the centroid of the region between f(x)=&quot;,
convert(f,string),&quot;, g(x)=&quot;,convert(g,string),&quot;, x=&quot;,
x1,&quot;, and x=&quot;,convert(x2,string),&quot;.&quot;));
Set(TFM=&quot;&quot;);
Set(TFMval=&quot;&quot;);
Set(TFMy=&quot;&quot;);
Set(TFMyval=&quot;&quot;);
Set(TFMx=&quot;&quot;);
Set(TFMxval=&quot;&quot;);
Set(TFX=&quot;&quot;);
Set(TFY=&quot;&quot;);
Set(reply=&quot;&quot;);
pad:=(x2-x1)/5;
p1:=plot([f,g], x=x1..x2, color=[red,blue], thickness=2);
p2:=plot([[[x1,eval(f,x=x1)],[x1,eval(g,x=x1)]],
          [[x2,eval(f,x=x2)],[x2,eval(g,x=x2)]]], color=black, thickness=2);
p3:=plot(0, x=x1..x2, color=white);
p4:=plot(0, x=x1..x2, color=white);
Set(graph=display([p1,p2], view=[x1-pad..x2+pad,default]));
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L37" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L36" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintM:=proc()
Set(TFM=&quot; Int( f(x) - g(x), x=a..b)&quot;):
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L9" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkM:=proc()
global M, Mval;
local userM, userMval;
userM:=Get(TFM::{function, realcons &amp;* function}):
userMval:=Get(TFMval::realcons):
if simplify(userM-M)=0 and userMval=Mval then
  Set(reply=&quot;Correct!&quot;)
elif userM=M then
  Set(reply=&quot;The integral is correct, but the value is wrong. Try again.&quot;)
else
  Set(reply=&quot;The integral is wrong. Try again.&quot;)
end if;
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L11" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showM:=proc()
global M, Mval:
Set(TFM=M):
Set(TFMval=Mval):
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L34" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L35" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintMy:=proc () 
Set(TFMy=&quot; Int( x * ( f(x) - g(x) ), x=a..b)&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L13" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkMy:=proc()
global My, Myval:
local userMy, userMyval:
userMy:=Get(TFMy::{function, realcons &amp;* function}):
userMyval:=Get(TFMyval::realcons):
if simplify(userMy-My)=0 and userMyval=Myval then
  Set(reply=&quot;Correct!&quot;):
elif userMy=My then
  Set(reply=&quot;The integral is correct, but the value is wrong. Try again.&quot;):
else
  Set(reply=&quot;The integral is wrong. Try again.&quot;):
end if:
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L17" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showMy:=proc ()
global My, Myval:
Set(TFMy=My); 
Set(TFMyval=value(My)) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L32" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L33" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintMx:=proc () 
Set(TFMx=&quot; 1/2 * Int( f(x)^2 - g(x)^2, x=a..b)&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L18" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkMx:=proc ()  
global Mx, Mxval;
local userMx, userMxval;
userMx:=Get(TFMx::{function, realcons &amp;* function}); 
userMxval:=Get(TFMxval::realcons); 
if simplify(userMx-Mx)=0 and userMxval=Mxval then 
   Set(reply=&quot;Correct! &quot;) 
elif userMx=Mx then 
   Set(reply=&quot;The integral is correct, but the value is wrong. Try again.&quot;) 
else 
   Set(reply=&quot;The integral is wrong. Try again.&quot;) 
end if 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L20" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showMx:=proc () 
global Mx, Mxval;
Set(TFMx=Mx); 
Set(TFMxval=value(Mx)) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L31" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L30" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintX:=proc () 
Set(TFX=&quot; My / M&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L22" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkX:=proc () 
global X, f, g, x1, x2, pad, p1, p2, p3, p4;
local userX; 
userX:=Get(TFX::realcons); 
if userX=X then 
  Set(reply=&quot;Correct!&quot;);
  p3:=plot([[X,eval(f, x=X)], [X,eval(g, x=X)]], color=green);
else 
  Set(reply=&quot;Incorrect. Try again.&quot;);
  p3:=plot([[userX,eval(f, x=userX)], [userX,eval(g, x=userX)]], color=red);
end if;
Set(graph=display([p1,p2, p3, p4], view=[x1-pad..x2+pad,default]));
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L23" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showX:=proc ()
global X, f, g, x1, x2, pad, p1, p2, p3, p4;
Set(TFX=X);
p3:=plot([[X,eval(f, x=X)], [X,eval(g, x=X)]], color=green);
Set(graph=display([p1,p2, p3, p4], view=[x1-pad..x2+pad,default]));
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L28" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L27" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">hintY:=proc () 
Set(TFY=&quot; Mx / M&quot;) 
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L24" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">checkY:=proc ()
global Y, x1, x2, pad, p1, p2, p3, p4;
local userY;
userY:=Get(TFY::realcons);
if userY=Y then
  Set(reply=&quot;Correct!&quot;);
  p4:=plot(Y, x=x1..x2, color=green);
else
  Set(reply=&quot;Incorrect. Try again.&quot;);
  p4:=plot(userY, x=x1..x2, color=red);
end if;
Set(graph=display([p1,p2, p3, p4], view=[x1-pad..x2+pad,default]));
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L26" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">showY:=proc () 
global Y, x1, x2, pad, p1, p2, p3, p4;
Set(TFY=Y);
p4:=plot(Y, x=x1..x2, color=green);
Set(graph=display([p1,p2, p3, p4], view=[x1-pad..x2+pad,default]));
end proc:</Text-field>
</Input>
</Group>
<Group labelreference="L29" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L4" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">CenterOfMass:=Maplet(onstartup=RunWindow(MAIN),
Window[MAIN](title=&quot;Center of Mass of a Plate with Constant Density&quot;,
defaultbutton=BMT,
[ halign=none, valign=none, inset=0, spacing=0,
  [ halign=none,
    Button(&quot;New Problem&quot;, Evaluate(function=&quot;ask&quot;), background=magenta),
    HorizontalGlue(),
    Button(&quot;Quit&quot;, Shutdown(), background=pink)
  ],
  [ halign=none, valign=none, inset=0,
    [ halign=none, valign=none, inset=0,
      [ halign=none, border=true,
        caption=&quot;Problem Statement&quot;,
        TextBox[question](width=30, height=4, editable=false)
      ],
      VerticalGlue(),
      BoxColumn( inset=0, border=true,
        caption=&quot;Find the total mass.  Enter the integral and value.&quot;,
        [ halign=none,
          &quot;M =&quot;, 
          TextField[TFM](width=20, background=turquoise),
          &quot;=&quot;,
          TextField[TFMval](width=10, background=turquoise), 
          HorizontalGlue()
        ], 
        [ halign=none,
          HorizontalGlue(),
          Button[BMT](&quot;Template&quot;, Evaluate(function=&quot;hintM&quot;), background=lightorange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkM&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showM&quot;), background=lightorange),
          HorizontalGlue()
        ]
      )
    ],
    [ halign=none, valign=none, border=true,
      caption=&quot;Plot of Plate&quot;,
      Plotter[graph](plot(0,x=0..6), width=300, height=200)
    ]
  ],
  [ halign=none, valign=none, inset=0,
    [ halign=none, valign=none, inset=0, spacing=0, border=true,
      BoxColumn( valign=none, inset=0, border=true,
        caption=&quot;Find the moment about the y-axis (integral and value):&quot;,
        [ halign=none,
          &quot;My =&quot;,
          TextField[TFMy](width=20, background=turquoise),
          &quot;=&quot;,
          TextField[TFMyval](width=10, background=turquoise)
        ],
        [ halign=none,
          HorizontalGlue(),
          Button(&quot;Template&quot;, Evaluate(function=&quot;hintMy&quot;), background=lightorange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkMy&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showMy&quot;), background=lightorange),
          HorizontalGlue()
        ]
      ),
      BoxColumn( valign=none, inset=0, spacing=0, border=true,
        caption=&quot;Find the x-coordinate of the center of mass:&quot;,
        [ halign=none,
          HorizontalGlue(),
          &quot;X =&quot;,
          TextField[TFX](width=10, background=turquoise),
          HorizontalGlue()
        ],
        [ halign=none,
          HorizontalGlue(),
          Button(&quot;Template&quot;, Evaluate(function=&quot;hintX&quot;), background=lightorange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkX&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showX&quot;), background=lightorange),
          HorizontalGlue()
        ]
      )
    ],
    [ halign=none, valign=none, inset=0, spacing=0, border=true,
      BoxColumn( valign=none, inset=0, border=true,
        caption=&quot;Find the moment about the x-axis (integral and value):&quot;,
        [ halign=none,
          &quot;Mx =&quot;,
          TextField[TFMx](width=20, background=turquoise),
          &quot;=&quot;,
          TextField[TFMxval](width=10, background=turquoise)
        ],
        [ halign=none,
          HorizontalGlue(),
          Button(&quot;Template&quot;, Evaluate(function=&quot;hintMx&quot;), background=lightorange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkMx&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showMx&quot;), background=lightorange),
          HorizontalGlue()
        ]
      ),
      BoxColumn( valign=none, inset=0, spacing=0, border=true,
        caption=&quot;Find the y-coordinate of the center of mass:&quot;,
        [ halign=none,
          HorizontalGlue(),
          &quot;Y =&quot;,
          TextField[TFY](width=10, background=turquoise),
          HorizontalGlue()
        ],
        [ halign=none,
          HorizontalGlue(),
          Button(&quot;Template&quot;, Evaluate(function=&quot;hintY&quot;), background=lightorange),
          Button(&quot;Check&quot;, Evaluate(function=&quot;checkY&quot;), background=green),
          Button(&quot;Show&quot;, Evaluate(function=&quot;showY&quot;), background=lightorange),
          HorizontalGlue()
        ]
      )
    ]
  ],
  TextField[reply](width=60),
  [ &quot;Programmers: Sarah Mannen and Talha Ramzan&quot;,
    HorizontalGlue(),
<Font encoding="UTF-8">    &quot;\302\251 copyright P. Yasskin 2007&quot;
</Font>  ]
]
)
):</Text-field>
</Input>
</Group>
<Group labelreference="L6" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">Maplets[Display](CenterOfMass);</Text-field>
</Input>
</Group>
<Group labelreference="L39" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal"></Text-field>
</Input>
</Group>
</Worksheet>
