■Write an algorithm Only that will calculate the roots of a quadratic equation
ax^2+bx+c=0
■ Hint: d = sqrt ( b^2-4ac ), and the roots are: x1 = (–b + d)/2a and x2 = (–b – d)/2a
■Write an algorithm Only that will calculate the roots of a quadratic equation
ax^2+bx+c=0
■ Hint: d = sqrt ( b^2-4ac ), and the roots are: x1 = (–b + d)/2a and x2 = (–b – d)/2a
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no there
Step4;printx1 and x2
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
step1: input a,b,c
step2: d = sqrt ( b^2-4ac )
step3 : if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else no there
step4; print “x1 and x2”
step1: input a,b,c
step2: d = sqrt ( b^2-4ac )
step3: if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no there
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1input a ، b ، c
Step2 ؛ d = sqrt (b ^ 2-4ac)
Step3 if(d. ^ 0)
so
× 1 = (- b + d) / 2a
x2 = (-bd) / 2a
else
no real roots
Step4 ؛ printx1 و x2
step1 start
step2 input a,b,c
step3 d=sqrt ( b^2-4ac )
step4 if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
step5 print x1,x2
step6 end
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
step1: input a,b,c
step2: d = sqrt ( b^2-4ac )
step3: if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Algorithm
Step1/INputa b, c
Step2/veada b, c
Step3/check
B2-4ac=0
if d >0
solve x1, x2
Else
Printh or ealvoots and if
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no roots
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no roots
Step4;printx1 and x
step1;start requesting data from user
step2: input a,b,c
step3: d = sqrt ( b^2-4ac )
step4: if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step5; print “x1 and x2”
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
step1|start
Step2|input a,b,c
Step3| d=sqrt (b^2-4ac)
Step4|if (d.^0)
yes
×1=(-b+d)/2a
x2=( -b-d)/2a
no
no real roots
Step5|printx1 and x2
step6|end
step1: input a,b,c
step2: d = sqrt ( b^2-4ac )
step3: if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
step1|start
Step2;input a,b,c
Step3; d=sqrt (b^2-4ac)
Step4;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step5;printx1 and x2
step6|end
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
step1:printin a,b,c
step2:sqrt (d^2-4ac)
step3:if (d>0)
then x1=(-b+d)/2a
,x2=(-b-d)/2a
else “لا يوجد”
step4:printout x1,x2
step1:printin a,b,c
step2:d=sqrt (b^2-4ac)
step3:if (d>0)
then x1=(-b+d)/2a
,x2=(-b-d)/2a
else “لا يوجد”
step4: printout x1,x2
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
1-input a,b,c
2- d=sqrt (b^2-4ac)
3-if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
4-printx1 and x2
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Step1 ؛ المدخلات a ، b ، c
Step2 ؛ d = sqrt (b ^ 2-4ac)
Step3 ؛ إذا (d. ^ 0)
ثم
× 1 = (- b + d) / 2a
x2 = (-bd) / 2a
آخر
لا يوجد
Step4 ؛ printx1 و x2
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Step1;read a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
1-Start
2-Input a, b, c
3-Sqrt (2b ^-4ac)
4-Ifd >0 Then
Root1 is (-b-d)
Root2 is (-b+d)
5-printR1, R2
6-END.
Step1 ; input a,b,c
Step2 ; d= sqrt (b^2-4ac)
Step3 ; if (d>0)
then
X1=(-b+d)/2a
X2=(-b-d)/2a
else
No real roots
Step4; “X1 and X2”
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
1-Start
2-Input a, b, c
3-Sqrt (2b ^ – 4ac)
4-Ifd >0 Then
Root1 is (-b-d)/2a
Root2 is (-b+d) /2a
5-printR1, R2
6-END
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no there
Step4;printx1 and x2
Step1;read a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1;read a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Step1;read a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Step1:Printin a, b, c
Step2:sqrt(d^ 2-4ac)
Step3:if(d>0)
then x1=(-b+d) /2a
,x2=(-b-d)/2a
else”لايوجد”
Step4:Printoutx1, x2
Step1:Printin a, b, c
Step2:sqrt(d^2-4ac)
Step3:if(d>0)
then x1=(-b+d) /2a
,x2=(-b-d)/2a
else”لا يوجد”
Step4:Printoutx1, x2
Step 1start
Step2 input a,b,c
Step3 d=sqrt(b^2-4ac)
Step4 if(d.^0)
Then
x1=(-b-d)/2a
else
no real roots
Step5 print X1,x2
Step6 end
Algorithm
Step1: input a, b, c
Step2:Read a, b, c
Step3:check if (d=b*b-4ac>or=0 )
Then
Solve x1, x2
Else
No real roots
Step4:print x1, x2
الخطوة 1: إدخال a ، b ، c
step2: d = sqrt (b ^ 2-4ac)
step3: if (d> 0)
ثم
x1 = (–b + d) / 2a
x2 = (–b – d) / 2a
else
لا يوجد
step4 ؛ اطبع “x1 و x2”
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
➡️Step1
؛ المدخلات a ، b ، c
Step2
؛ d = sqrt (b ^ 2-4ac)
Step3
؛ إذا (d. ^ 0)
ثم
× 1 = (- b + d) / 2a
x2 = (-bd) / 2a
آخر
لا جذور حقيقية
Step4
؛ printx1 و x2⬅️
.
.
جهاد حسن ابراهيم محمد الخبيري
* Sec 9 *
* Group 2 *
➡️1-ابدأ
2-الإدخال a، b، c
3-Sqrt (2b ^ – 4ac)
4- Ifd > 0 ثم
Root1 is (-bd) / 2a
Root2 is (-b + d) / 2a
5-printR1، R2
6 -النهاية⬅️
فريدة حازم مصطفي السيد
سكشن ١٠
المجموعة الثانية
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2
step1; input a,b,c
step2; d = sqrt ( b^2-4ac )
step3; if (d>0)
then
x1 = (–b + d)/2a
x2 = (–b – d)/2a
else
no there
step4; print “x1 and x2”
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2.
NAME: Heba Mahmoud mohamed Elbody.
LEVEL Zero.
Step1 ; input a,b,c
Step2 ; d= sqrt (b^2-4ac)
Step3 ; if (d>0)
then
X1=(-b+d)/2a
X2=(-b-d)/2a
else
No real roots
Step4; “X1 and X2”
Step1;input a,b,c
Step2; d=sqrt (b^2-4ac)
Step3;if (d.^0)
then
×1=(-b+d)/2a
x2=( -b-d)/2a
else
no real roots
Step4;printx1 and x2