<?xml version="1.0" encoding="UTF-8"?>
<Worksheet>
<Version major="12" minor="0"/>
<Label-Scheme value="2" prefix=""/>
<View-Properties presentation="false"><Zoom percentage="125"/></View-Properties>
<MapleNet-Properties elisiondigitsbefore="100" labelling="true" indentamount="4" elisiontermsthreshold="10000" ansi="false" errorbreak="1" useclientjvm="true" echo="1" imaginaryunit="I" labelwidth="20" plotdriver="openviz" elisiondigitsafter="100" plotoutput="terminal" rtablesize="10" elisiontermsbefore="100" elisiondigitsthreshold="10000" typesetting="standard" plotdevice="inline" verboseproc="1" showassumed="1" errorcursor="false" longdelim="true" plotoptions="" quiet="false" elisiontermsafter="100" screenwidth="79" preplot="" prettyprint="3" displayprecision="-1" warnlevel="3" screenheight="25" latexwidth="6.0" postplot="" prompt="&gt; " ShowLabels="true"/>
<Styles><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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="true"/>
<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" placeholder="false"/>
<Font name="Code" background="[255,255,255]" bold="false" executable="false" family="Monospaced" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="false"/>
<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" placeholder="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" placeholder="false"/>
<Font name="Maple Input" background="[0,0,0]" bold="true" executable="true" family="Monospaced" foreground="[255,0,0]" italic="false" opaque="false" readonly="false" size="12" subscript="false" superscript="false" underline="false" placeholder="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" placeholder="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" placeholder="false"/>
<Font name="Header and Footer" 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" placeholder="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" placeholder="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" placeholder="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" placeholder="false"/>
<Font name="Text" background="[0,0,0]" 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" placeholder="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" placeholder="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" placeholder="false"/>
<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" placeholder="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" placeholder="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" placeholder="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" placeholder="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" placeholder="false"/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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" bulletsuffix=""/>
<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 4" pen-color="[0,0,255]" pen-height="3.0" pen-width="3.0" pen-opacity="1.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 2" pen-color="[0,0,255]" pen-height="1.0" pen-width="1.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"/>
<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 1" pen-color="[255,153,255]" pen-height="12.0" pen-width="8.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 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>
<Task>
</Task>
<Group labelreference="L2">
<Input>
<Text-field style="Text" layout="Normal" alignment="centred"><Font bold="true" encoding="UTF-8" foreground="[102,204,0]" size="36">4. El\303\251ments de programmation</Font></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal">Les mots  <Font bold="true">if (si)</Font>, <Font bold="true">then (alors)</Font> et <Font bold="true">else (sinon)</Font> sont les trois instructions fondamentales en programmation. La commande</Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">elif (sinon si)</Font> est une contraction de &quot;else if&quot;.
</Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true" foreground="[0,102,102]" size="18">1. L'instruction conditionnelle if</Font>
</Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true" foreground="[204,0,204]" size="14">Syntaxe :</Font><Font bold="true" size="14">
</Font><Font bold="true">if </Font>condition 1 <Font bold="true">then</Font> instruction 1; <Font bold="true">
<Font font_style_name="_cstyle5" superscript="false" placeholder="false" executable="false" selection-placeholder="false" italic="false" size="12" style="_cstyle5" subscript="false" family="Times New Roman" opaque="false" background="[0,0,0]" underline="false" readonly="false" foreground="[0,0,0]">elif</Font></Font> condition 2 <Font font_style_name="_cstyle5" superscript="false" placeholder="false" executable="false" selection-placeholder="false" italic="false" size="12" bold="true" style="_cstyle5" subscript="false" family="Times New Roman" opaque="false" underline="false" background="[0,0,0]" readonly="false" foreground="[0,0,0]">then</Font> instruction 2;</Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">else</Font> instruction 3<Font bold="true">
end</Font>;</Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">Exemple </Font><Font encoding="UTF-8">: affichage du maximum de deux nombres r\303\251els a et b.</Font></Text-field>
</Input>
</Group>
<Group labelreference="L3">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">a:=15;b:=5;</Text-field>
</Input>
</Group>
<Group labelreference="L4">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">if a&gt;=b then print(`max(a,b)`=a) else print(`max(a,b)`=b) end;</Text-field>
</Input>
</Group>
<Group labelreference="L20">
<Input>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font font_style_name="_cstyle5" superscript="false" placeholder="false" executable="false" selection-placeholder="false" italic="false" size="12" bold="true" style="_cstyle5" subscript="false" family="Times New Roman" opaque="false" underline="false" background="[0,0,0]" readonly="false" foreground="[0,0,0]">Exemple </Font><Font bold="true">:</Font><Font encoding="UTF-8"> r\303\251solution de l'\303\251quation du premier degr\303\251 ax+b=0.</Font></Text-field>
</Input>
</Group>
<Group labelreference="L25">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart; </Text-field>
</Input>
</Group>
<Group labelreference="L27">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">a:=7;b:=3; </Text-field>
</Input>
</Group>
<Group labelreference="L16">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">if a&lt;&gt;0 then print(`Une solution : x `=-b/a)
elif b=0 then print(`Tout x est solution`)
else print(`Pas de solution`)
end;</Text-field>
</Input>
</Group>
<Group labelreference="L5">
<Input>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true" foreground="[0,102,102]" size="18">2. Les boucles for (pour) et while (tant que)</Font></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font encoding="UTF-8">Dans une boucle for, un bloc d'instructions est ex\303\251cut\303\251 pour des indices compris entre des valeurs fix\303\251es par le programmeur. Le nombre d'it\303\251rations de la boucle est donc connu \303\240 l'avance.</Font></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true" foreground="[204,0,204]" size="14">Syntaxe :</Font></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">for</Font><Font encoding="UTF-8"> i from valeur_d\303\251but to valeur_fin by pas </Font><Font bold="true">do </Font>instruction <Font bold="true">end</Font>;</Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
</Input>
</Group>
<Group labelreference="L6">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">for i from 1 to 10 do evalf(sin(i)) end;</Text-field>
</Input>
</Group>
<Group labelreference="L7">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">for k from -10 to 0 by 2 do print((k)^`3`=k^3) end;</Text-field>
</Input>
</Group>
<Group labelreference="L8">
<Input>
<Text-field style="Text" layout="Normal"><Font encoding="UTF-8">Dans une boucle while, un bloc d'instructions est ex\303\251cut\303\251 tant qu'une condition fix\303\251e par programmeur reste vraie. Le nombre d'it\303\251rations de la boucle n'est pas connu \303\240 l'avance.</Font>
</Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true" foreground="[204,0,204]" size="14">Syntaxe :</Font></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">while</Font> condition vraie <Font bold="true">do</Font>  instruction <Font bold="true">end</Font>;
</Text-field>
<Text-field style="Text" layout="Normal"><Font encoding="UTF-8">Ex\303\251cute une suite d'instructions, tant que la condition est vraie.</Font></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">Exemple :</Font><Font encoding="UTF-8"> donner le premier nombre premier sup\303\251rieur \303\240 44^44.</Font></Text-field>
</Input>
</Group>
<Group labelreference="L9">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">n:=44^44;</Text-field>
</Input>
</Group>
<Group labelreference="L10">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">m:=n:while not(isprime(m)) do m:=m+1 end: 
<Font encoding="UTF-8">print(`le premier nombre premier sup\303\251rieur \303\240 n est`= m);
print(`\303\251cart avec n`= m-n);</Font></Text-field>
</Input>
</Group>
<Group labelreference="L11">
<Input>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8" foreground="[0,102,102]" size="18">3. Les proc\303\251dures</Font></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font encoding="UTF-8">Maple permet de d\303\251finir de nouvelles fonctions calculant un r\303\251sultat \303\240 partir d'arguments, c'est ce que l'on appelle des proc\303\251dures.</Font></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true" foreground="[204,0,204]" size="14">Syntaxe :</Font></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">Nom</Font>:=<Font bold="true">proc</Font>(arguments)</Text-field>
<Text-field style="Text" layout="Normal">local variables (cette ligne est optionnelle)
global variables (cette ligne est optionnelle)
instruction 1; instruction 2;... </Text-field>
<Text-field style="Text" layout="Normal">return resultat<Font bold="true">
end</Font>;</Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal">Une variable locale est une variable qui <Font bold="true" encoding="UTF-8">n'est reconnue qu'\303\240 l'int\303\251rieur de la proc\303\251dure</Font>, <Font encoding="UTF-8">contrairement \303\240 une variable globale accessible en dehors de la proc\303\251dure.</Font></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">Remarque</Font><Font encoding="UTF-8"> : quand on ex\303\251cute une proc\303\251dure, c'est le r\303\251sultat de la derni\303\250re instruction qui est affich\303\251.</Font></Text-field>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">Exemple : </Font><Font encoding="UTF-8">une suite g\303\251om\303\251trique.</Font></Text-field>
</Input>
</Group>
<Group labelreference="L112">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">proced:=proc(a,n)
local u,k;
u:=1;
for k from 1 to n do u:=a*u
end;
return u
end;</Text-field>
</Input>
</Group>
<Group labelreference="L129">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">seq(proced(2,n),n=0..10);</Text-field>
</Input>
</Group>
<Group labelreference="L127">
<Input>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">Exemple :</Font> les suites de Fibonacci <Equation executable="false" style="2D Math" input-equation="" display="LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYrLUklbXN1YkdGJDYlLUkjbWlHRiQ2JVEidUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1GIzYnLUYjNiktRi82JVEibkYnRjJGNS1JI21vR0YkNi1RIitGJy9GNlEnbm9ybWFsRicvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRkcvJSlzdHJldGNoeUdGRy8lKnN5bW1ldHJpY0dGRy8lKGxhcmdlb3BHRkcvJS5tb3ZhYmxlbGltaXRzR0ZHLyUnYWNjZW50R0ZHLyUnbHNwYWNlR1EsMC4yMjIyMjIyZW1GJy8lJ3JzcGFjZUdGVi1JI21uR0YkNiRRIjJGJ0ZDLyUrZm9yZWdyb3VuZEdRKlswLDAsMjU1XUYnLyUpcmVhZG9ubHlHRjQvJTBmb250X3N0eWxlX25hbWVHUSoyRH5PdXRwdXRGJ0ZDRmduRmpuRlxvRkMvJS9zdWJzY3JpcHRzaGlmdEdRIjBGJy1GQDYtUSI9RidGQ0ZFRkhGSkZMRk5GUEZSL0ZVUSwwLjI3Nzc3NzhlbUYnL0ZYRmZvLUYsNiUtRi82JVEjYXVGJ0YyRjUtRiM2Jy1GIzYpRjxGPy1GWjYkUSIxRidGQ0ZnbkZqbkZcb0ZDRmduRmpuRlxvRkNGX29GPy1GLDYlLUYvNiVRI2J1RidGMkY1LUYjNidGPEZnbkZqbkZcb0ZDRl9vRmduRmpuRlxvRkM=">LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYrLUklbXN1YkdGJDYlLUkjbWlHRiQ2JVEidUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1GIzYnLUYjNiktRi82JVEibkYnRjJGNS1JI21vR0YkNi1RIitGJy9GNlEnbm9ybWFsRicvJSZmZW5jZUdRJmZhbHNlRicvJSpzZXBhcmF0b3JHRkcvJSlzdHJldGNoeUdGRy8lKnN5bW1ldHJpY0dGRy8lKGxhcmdlb3BHRkcvJS5tb3ZhYmxlbGltaXRzR0ZHLyUnYWNjZW50R0ZHLyUnbHNwYWNlR1EsMC4yMjIyMjIyZW1GJy8lJ3JzcGFjZUdGVi1JI21uR0YkNiRRIjJGJ0ZDLyUrZm9yZWdyb3VuZEdRKlswLDAsMjU1XUYnLyUpcmVhZG9ubHlHRjQvJTBmb250X3N0eWxlX25hbWVHUSoyRH5PdXRwdXRGJ0ZDRmduRmpuRlxvRkMvJS9zdWJzY3JpcHRzaGlmdEdRIjBGJy1GQDYtUSI9RidGQ0ZFRkhGSkZMRk5GUEZSL0ZVUSwwLjI3Nzc3NzhlbUYnL0ZYRmZvLUYsNiUtRi82JVEjYXVGJ0YyRjUtRiM2Jy1GIzYpRjxGPy1GWjYkUSIxRidGQ0ZnbkZqbkZcb0ZDRmduRmpuRlxvRkNGX29GPy1GLDYlLUYvNiVRI2J1RidGMkY1LUYjNidGPEZnbkZqbkZcb0ZDRl9vRmduRmpuRlxvRkM=</Equation>.</Text-field>
</Input>
</Group>
<Group labelreference="L126">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;
proced:=proc(a,b,u0,u1,n)
local u,k;
u:=u0,u1;
for k from 1 to n do u:=u[2],b*u[1]+a*u[2]
end;
return u[1]
end;</Text-field>
</Input>
</Group>
<Group labelreference="L125">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">seq(proced(1,1,0,1,n),n=0..20); # c'est la suite u_0=0,u_1=1,u_(n+2)=u_(n+1)+u_n</Text-field>
</Input>
</Group>
<Group labelreference="L132">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">v:=n-&gt;(((1+sqrt(5))/2)^n-((1-sqrt(5))/2)^n)/sqrt(5);</Text-field>
</Input>
</Group>
<Group labelreference="L134">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">simplify(v(100)-proced(1,1,0,1,100)); </Text-field>
</Input>
</Group>
<Group labelreference="L138">
<Input>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true" encoding="UTF-8">V\303\251rification :</Font> on compare <Equation executable="false" style="2D Math" input-equation="" display="LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYoLUklbXN1YkdGJDYlLUkjbWlHRiQ2JVEidUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1GIzYnLUYvNiVRIm5GJ0YyRjUvJStmb3JlZ3JvdW5kR1EqWzAsMCwyNTVdRicvJSlyZWFkb25seUdGNC8lMGZvbnRfc3R5bGVfbmFtZUdRKjJEfk91dHB1dEYnL0Y2USdub3JtYWxGJy8lL3N1YnNjcmlwdHNoaWZ0R1EiMEYnLUYvNiNRIUYnRj1GQEZCRkU=">LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYoLUklbXN1YkdGJDYlLUkjbWlHRiQ2JVEidUYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1GIzYnLUYvNiVRIm5GJ0YyRjUvJStmb3JlZ3JvdW5kR1EqWzAsMCwyNTVdRicvJSlyZWFkb25seUdGNC8lMGZvbnRfc3R5bGVfbmFtZUdRKjJEfk91dHB1dEYnL0Y2USdub3JtYWxGJy8lL3N1YnNjcmlwdHNoaWZ0R1EiMEYnLUYvNiNRIUYnRj1GQEZCRkU=</Equation> et <Equation executable="false" style="2D Math" input-equation="" display="LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUklbXN1YkdGJDYlLUkjbWlHRiQ2JVEidkYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1GIzYnLUYvNiVRIm5GJ0YyRjUvJStmb3JlZ3JvdW5kR1EqWzAsMCwyNTVdRicvJSlyZWFkb25seUdGNC8lMGZvbnRfc3R5bGVfbmFtZUdRKjJEfk91dHB1dEYnL0Y2USdub3JtYWxGJy8lL3N1YnNjcmlwdHNoaWZ0R1EiMEYnRj1GQEZCRkU=">LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUklbXN1YkdGJDYlLUkjbWlHRiQ2JVEidkYnLyUnaXRhbGljR1EldHJ1ZUYnLyUsbWF0aHZhcmlhbnRHUSdpdGFsaWNGJy1GIzYnLUYvNiVRIm5GJ0YyRjUvJStmb3JlZ3JvdW5kR1EqWzAsMCwyNTVdRicvJSlyZWFkb25seUdGNC8lMGZvbnRfc3R5bGVfbmFtZUdRKjJEfk91dHB1dEYnL0Y2USdub3JtYWxGJy8lL3N1YnNjcmlwdHNoaWZ0R1EiMEYnRj1GQEZCRkU=</Equation>.</Text-field>
</Input>
</Group>
<Group labelreference="L137">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">n:=0;N:=100:while simplify(v(n)-proced(1,1,0,1,n))=0 and n&lt;N do n:=n+1 end: 
<Font encoding="UTF-8">if n=N then print(`l'\303\251galit\303\251 u=v est vraie jusqu'\303\240 l'entier` =N) 
</Font>else print(`<Font encoding="UTF-8">l'\303\251galit\303\251 u=v est fausse</Font>`) end;</Text-field>
</Input>
</Group>
<Group labelreference="L139" drawlabel="true">
<Input>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">Exemple :</Font> les flocons de Von Koch.</Text-field>
</Input>
</Group>
<Group labelreference="L141" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;
Von_Koch:=proc(n,xa,ya,xb,yb)
local x1,y1,x2,y2,x3,y3;
  if n=0 then [xa,ya],[xb,yb]
  else
  x1:=evalf((2*xa+xb)/3);y1:=evalf((2*ya+yb)/3);
  x3:=evalf((xa+2*xb)/3);y3:=evalf((ya+2*yb)/3);
  x2:=evalf(1/2*(x1+x3-sqrt(3)*(y3-y1)));
  y2:=evalf(1/2*(y1+y3+sqrt(3)*(x3-x1)));
  Von_Koch(n-1,xa,ya,x1,y1),Von_Koch(n-1,x1,y1,x2,y2),
  Von_Koch(n-1,x2,y2,x3,y3),Von_Koch(n-1,x3,y3,xb,yb)
  end; 
end; </Text-field>
</Input>
</Group>
<Group labelreference="L142" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">for k from 0 to 5 do 'k'=k;plot([Von_Koch(k,0,0,1,0)],axes=none,scaling=constrained) end;</Text-field>
</Input>
</Group>
<Group labelreference="L143" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">plot({seq([Von_Koch(k,0,0,1,1)],k=0..5)},axes=none,scaling=constrained,color=black); </Text-field>
</Input>
</Group>
<Group labelreference="L145" drawlabel="true">
<Input>
<Text-field style="Text" layout="Normal"></Text-field>
<Text-field style="Text" layout="Normal"><Font bold="true">Exemple :</Font> les ensembles de Sierpinski.</Text-field>
</Input>
</Group>
<Group labelreference="L146" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">restart;with(plots):
sierpinski:=proc(x,y,a,n,p) local b;                                                             
b:=1/(2*evalf(sum(cos(2*q*Pi/n),q=0..floor(n/4))));   
  if p=0 then polygonplot([seq([x+a*cos(k*2*Pi/n-(n+2)*Pi/(2*n)),
  y+a*sin(k*2*Pi/n-(n+2)*Pi/(2*n))],k=1..n)])  
  else seq(sierpinski(x+(1-b)*a*cos(k*2*Pi/n-(n+2)*Pi/(2*n)),
  y+(1-b)*a*sin(k*2*Pi/n-(n+2)*Pi/(2*n)),a*b,n,p-1),k=1..n) 
  end;
end;  </Text-field>
</Input>
</Group>
<Group labelreference="L147" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">for k from 0 to 5 do display(sierpinski(0,0,1,3,k),axes=none,scaling=constrained) end;</Text-field>
</Input>
</Group>
<Group labelreference="L148" drawlabel="true">
<Input>
<Text-field prompt="&gt; " style="Maple Input" layout="Normal">for k from 0 to 4 do display(sierpinski(0,0,1,5,k),axes=none,scaling=constrained) end;</Text-field>
</Input>
</Group>
</Worksheet>