OEF Exercise - Calculs simples sur les relatifs
Calculs simples sur les relatifs
GNU GPL
Algebra
- H2
relatif addition soustraction multiplication division
Nouvel exercice de compréhension des opérations sur les relatifs
Il s'agit d'opérations - additions, soustractions, multiplications, divisions- à deux termes ou facteurs.
\title{Calculs simples sur les relatifs}
\author{Odile Bénassy}
\email{obenassy@free.fr}
\computeanswer{no}
\format{html}
\precision{100}
\integer{a1=random(6..35)}
\integer{a2=random(6..35)}
\integer{s1=random(-1,1)}
\integer{s2=random(-1,1)}
\integer{opeitem=random(1..4)}
\if{\opeitem=4}{\integer{a1=\a1*\a2}}
\integer{x1=\s1 * \a1}
\integer{x2=\s2 * \a2}
\if{\a1=\a2}{
\integer{a2=\a2+1}
\integer{x2=\s2 * \a2}
}
\text{x2aff= \s2=-1? (\x2) : \x2}
\text{ope=item(\opeitem, +,-,*,/)}
\text{opeaff=item(\opeitem, +,-,x,:)}
\text{openames=addition, soustraction, multiplication, division}
\text{opename=item(\opeitem, \openames)}
\text{ope2=\ope}
\text{lignespeciale=}
\if{\s2=-1 and \ope isin +-}{
\integer{opeitem2= \opeitem=2? 1:2}
\text{ope2= item(\opeitem2, +,-,x,:)}
\text{lignespeciale=que j'écris tout de suite \x1 \ope2 \a2}
}
\matrix{operules1=les 2 nombres sont positifs, le nombre positif est le plus fort, un nombre positif multiplié par un nombre positif donne un nombre positif, un nombre positif divisé par un nombre positif donne un nombre positif, un nombre négatif multiplié par un nombre négatif donne un nombre positif, un nombre négatif divisé par un nombre négatif donne un nombre positif}
\matrix{operules2=les 2 nombres sont négatifs, le nombre négatif est le plus fort, un nombre positif multiplié par un nombre négatif donne un nombre négatif, un nombre positif divisé par un nombre négatif donne un nombre négatif, un nombre négatif multiplié par un nombre positif donne un nombre négatif, un nombre négatif divisé par un nombre positif donne un nombre négatif}
\integer{operuleitem=\opeitem}
\text{opename2=\opename}
\if{\s2=-1 and \ope isin +-}{
\integer{operuleitem= \opeitem=1? 2:1}
\text{opename2= item(\opeitem2, \openames)}
}
\if{\s1=-1 and \ope2=+}{
\integer{operuleitem=2}
\text{opename2=soustraction}
}
\if{\s1=-1 and \ope2=-}{
\integer{operuleitem=1}
\text{opename2=addition}
}
\if{\s1=-1 and \ope isin */}{
\integer{operuleitem = \operuleitem + 2}
}
\real{res=\x1 \ope \x2}
\if{\res=0}{\text{ressign=+,-}}{\integer{ressign=evalue(\res / abs(\res))}}
\text{ressignaff= \ressign=-1? - : +}
\if{\res=0}{\text{ressignaff=+,-}}
\text{operules= \ressign=1? \operules1 : \operules2}
\text{operule=item(\operuleitem, \operules)}
\steps{choice 1, choice 2
reply 1, choice 3
}
\statement{
\if{debug iswordof \oefenv}{<p>ESSAI : ressignaff=\ressignaff}
<p>Soit l'opération : <center>\x1 \opeaff \x2aff
<br><font size=-1 color=green>\lignespeciale</font></center>
\if{\step<=1}{<p>Le résultat est de signe \embed{choice 1}, <p>parce que \embed{choice 2}.}
\if{\step=2}{<p>Après avoir effectué une \embed{choice 3}, <p>je trouve \embed{reply 1,3}}
}
\choice{}{\ressignaff}{+,-}
\choice{}{\operule}{\operules}
\choice{}{\opename2}{\openames}
\answer{}{\res}{type=numeric}
2004-05-24 15:56:26
2005-02-18 06:27:35