File: /home/mmtprep/public_html/mathzen.mmtprep.com/assets/4L20-BdoX4Tra.js
import{E as W,c as y,aj as A,r as a,h as l,g as c,a as p,m as r,j as u,a0 as g,A as f,i as d,s as m,v as x,ay as q,l as C}from"./index-ajJ0B2-K.js";import{d as w,t as v}from"./deprecatedFractions-MjvQvhWQ.js";const S="Solve a first degree equation",M=!0,Q="mathLive",k=!0,I="AMCHybride",L="799c4",F="4L20";function R(){W.call(this),this.consigne="Solve the following equations.",this.spacing=2,this.interactifType="mathLive",y.isHtml?this.spacingCorr=3:this.spacingCorr=2,this.correctionDetailleeDisponible=!0,this.correctionDetaillee=y.isHtml,this.sup=!0,this.sup2=4,this.nbQuestions=6,this.listePackages="bclogo",this.nouvelleVersion=function(){this.listeQuestions=[],this.listeCorrections=[],this.autoCorrection=[],this.consigne=this.nbQuestions===1?"Solve the following equation.":"Solve the following equations.";let n;switch(this.sup2.toString()){case"1":n=["ax=b","x+b=c"];break;case"2":n=["ax+b=c"];break;case"3":n=["ax+b=cx+d"];break;case"4":n=["ax+b=0","ax+b=c","ax=b","x+b=c","ax+b=cx+d"];break;case"5":n=["x/a=b"];break;case"6":n=["ax/b=c"];break;case"7":n=["ax+b=0","ax+b=c","ax=b","x+b=c","ax+b=cx+d","x/a=b","ax/b=c"]}n=A(n,this.nbQuestions);for(let $=0,e,i,t,b,o,s,h,T=0;$<this.nbQuestions&&T<50;){if(e=a(2,13),i=a(1,13),t=a(1,13),b=a(1,13),this.sup&&(e*=l([-1,1]),i*=l([-1,1]),t*=l([-1,1]),b*=l([-1,1])),n[$]==="ax+b=0"||n[$]==="ax+b=c"){n[$]==="ax+b=0"&&(t=0);do e=a(2,13),i=a(1,13),t=a(1,13);while(Math.abs(t-i)%e===0);this.sup&&(e*=l([-1,1])),!this.sup&&t<i&&(t===0?i*=-1:(b=i,i=t,t=b)),o=`$${e}x${c(i)}=${t}$`,s=o+"<br>",o+=p(this,$,"width25 inline",{texteAvant:"<br>$ x = $"}),this.correctionDetaillee&&(i>0?s+=`We subtract $${i}$ from both sides.<br>`:s+=`We add $${-1*i}$ to both sides.<br>`),s+=`$${e}x${c(i)}${r(c(-1*i))}=${t}${r(c(-1*i))}$<br>`,s+=`$${e}x=${t-i}$<br>`,this.correctionDetaillee&&(s+=`We divide both sides by $${e}$.<br>`),s+=`$${e}x${r("\\div"+u(e))}=${t-i+r("\\div"+u(e))}$<br>`,s+=`$x=${w(t-i,e)}$`,(g(f(e),f(t-i))>1||e<0)&&(s+=`<br>$x=${v(t-i,e)}$`),s+=`<br> The solution is $${r(v(t-i,e))}$.`,h=d(t-i,e).simplifie(),m(this,$,h,{formatInteractif:"fractionEqual"})}if(n[$]==="x+b=c"&&(!this.sup&&t<i&&(i=a(-9,9,[0]),t=f(a(i,15))),o=`$x${c(i)}=${t}$`,s=o+"<br>",o+=p(this,$,"width25 inline",{texteAvant:"<br>$ x = $"}),this.correctionDetaillee&&(i>0?s+=`We subtract $${i}$ from both sides.<br>`:s+=`We add $${-1*i}$ to both sides.<br>`),s+=`$x${c(i)}${r(c(-1*i))}=${t}${r(c(-1*i))}$<br>`,s+=`$x=${t-i}$`,s+=`<br> The solution is $${r(t-i)}$.`,h=t-i,m(this,$,d(t-i,1),{formatInteractif:"fractionEqual"})),n[$]==="ax=b"){do e=a(2,13),i=a(1,13);while(i%e===0);this.sup&&(e*=l([-1,1]),i*=l([-1,1])),o=`$${e}x=${i}$`,s=o+"<br>",o+=p(this,$,"width25 inline",{texteAvant:"<br>$ x = $"}),this.correctionDetaillee&&(s+=`We divide both sides by $${e}$.<br>`),s+=`$${e}x${r("\\div"+u(e))}=${i+r("\\div"+u(e))}$<br>`,s+=`$x=${w(i,e)}$`,(g(f(e),f(i))>1||e<0)&&(s+=`<br>$x=${v(i,e)}$`),s+=`<br> The solution is $${r(v(i,e))}$.`,h=d(i,e).simplifie(),m(this,$,h,{formatInteractif:"fractionEqual"})}if(n[$]==="ax+b=cx+d"){do e=a(2,13),i=a(1,13),t=a(1,13),b=a(1,13),t===e&&(t=a(1,13,[e])),!this.sup&&e<t&&(t=a(1,9),e=a(t+1,15)),!this.sup&&b<i&&(i=a(1,9),b=a(i+1,15));while((b-i)%(e-t)===0);o=`$${x(e)}x${c(i)}=${x(t)}x${c(b)}$`,s=o+"<br>",o+=p(this,$,"width25 inline",{texteAvant:"<br>$ x = $"}),this.correctionDetaillee&&(t>0?s+=`We subtract $${x(t)}x$ from both sides.<br>`:s+=`We add $${x(-1*t)}x$ to both sides.<br>`),s+=`$${x(e)}x${c(i)}${r(q(-1*t)+x(f(t))+"x")}=${t}x${c(b)}${r(q(-1*t)+x(f(t))+"x")}$<br>`,s+=`$${x(e-t)}x${c(i)}=${b}$<br>`,this.correctionDetaillee&&(i>0?s+=`We subtract $${i}$ from both sides.<br>`:s+=`We add $${-1*i}$ to both sides.<br>`),s+=`$${x(e-t)}x${c(i)}${r(c(-1*i))}=${b}${r(c(-1*i))}$<br>`,s+=`$${x(e-t)}x=${b-i}$<br>`,this.correctionDetaillee&&(s+=`We divide both sides by $${e-t}$.<br>`),s+=`$${x(e-t)}x${r("\\div"+u(e-t))}=${b-i+r("\\div"+u(e-t))}$<br>`,s+=`$x=${w(b-i,e-t)}$`,(g(f(b-i),f(e-t))>1||e-t<0)&&(s+=`<br>$x=${v(b-i,e-t)}$`),s+=`<br> The solution is $${r(v(b-i,e-t))}$.`,h=d(b-i,e-t).simplifie(),m(this,$,h,{formatInteractif:"fractionEqual"})}if(n[$]==="x/a=b"){do e=a(2,13),i=a(1,13);while(i%e===0);this.sup&&(e*=l([-1,1]),i*=l([-1,1])),o=`$\\dfrac{x}{${e}}=${i}$`,s=o+"<br>",o+=p(this,$,"width25 inline",{texteAvant:"<br>$ x = $"}),this.correctionDetaillee&&(s+=`We multiply both sides by $${e}$.<br>`),s+=`$\\dfrac{x}{${e}}${r("\\times"+u(e))}=${i+r("\\times"+u(e))}$`,s+=`<br>$x=${i*e}$`,s+=`<br> The solution is $${r(i*e)}$.`,h=e*i,m(this,$,h)}if(n[$]==="ax/b=c"){do e=a(2,5),i=a(5,9),t=a(2,5);while(g(e,i)!==1);this.sup&&(e*=l([-1,1]),t*=l([-1,1])),o=`$\\dfrac{${e}x}{${i}}=${t}$`,s=o+"<br>",o+=p(this,$,"width25 inline",{texteAvant:"<br>$ x = $"}),this.correctionDetaillee&&(s+=`We multiply both sides by $\\dfrac{${e<0?-i:i}}{${Math.abs(e)}}$.<br>`),s+=`$\\dfrac{${e}x}{${i}}${r(`\\times\\dfrac{${e<0?-i:i}}{${Math.abs(e)}}`)}=${t+r(`\\times\\dfrac{${e<0?-i:i}}{${Math.abs(e)}}`)}$`,s+=`<br>$x=\\dfrac{${t*i*(e<0?-1:1)}}{${Math.abs(e)}}$`,g(t*i,e)!==1&&(s+=`<br>$x=${d(t*i,e).simplifie()}$`),s+=`<br> The solution is $${r(d(t*i,e).simplifie())}$.`,h=d(t*i,e).simplifie(),m(this,$,h,{formatInteractif:"fractionEqual"})}this.questionJamaisPosee($,e,i,t,n[$])&&(this.listeQuestions.push(o),this.listeCorrections.push(s),y.isAmc&&(this.autoCorrection[$]={enonce:"",propositions:[{type:"AMCNum",propositions:[{texte:s,statut:"",reponse:{texte:n[$]==="x+b=c"?`Solve ${o}.`:`Solve ${o} and give the solution in the form of an irreducible fraction.`,valeur:[h],param:{signe:this.sup}}}]}]}),$++),T++}C(this)},this.besoinFormulaireCaseACocher=["With relative numbers"],this.besoinFormulaire2Numerique=["Type of equations",7,`1: ax=b or x+a=b or x-a=b
2: ax+b=c
3: ax+b=cx+d
4: The previous 3 types
5: x/a=b
6 : ax/b=c
7: All types`]}export{k as amcReady,I as amcType,R as default,M as interactifReady,Q as interactifType,F as ref,S as titre,L as uuid};
//# sourceMappingURL=4L20-BdoX4Tra.js.map