Algo exrcise, URGENT... [Closed]

Posts
12
Registration date
Sunday February 7, 2016
Last seen
January 13, 2018
- - Latest reply: Ambucias
Posts
50333
Registration date
Monday February 1, 2010
Last seen
November 22, 2018
- Jan 14, 2018 at 07:34 AM
Hello, I hope u are well ...
If possible, is this treatment of Algo correct!! here is the excercise...

Write a function that recieves 3 parameters(A, B and C) and calculates the discriminant DELTA of trinomial of second degree AX2 + BX + C and which, according to its sign, calculates the real roots of the trinomial , and if necessary displays that there is no real root. The three coefficients A, B and C will be keyed in by the user(in main programme).

Correction

FUNCTION CALC_DELTA(A :ENTIER ,B :ENTIER ,C :ENTIER) :ENTIER
VARIABLES: D, X1, X2: INTEGER
D<-B*B-4*A*C;
RETURN DEL
END FUNCTION
Write('Input A');
Read(A)
Write('Input B')
Read(B)
Write('Input C')
Read(C)
Write( "the discriminant is:")
If D <0 then
Show "Delta is negative, trinome has no real roots"
Else
If dD = 0 then
Write ( "the trinoma has a root";x=takes the value -b / 2a)
If D> 0 then
Write "the trinoma has two distinct roots: x1 = -B-racined) / 2A and x2 = -b + racined / 2a
End
Thanks in advance
See more 

1 reply

Posts
50333
Registration date
Monday February 1, 2010
Last seen
November 22, 2018
0
Thank you
CCM will not help you. CCM does not provide help for homework. You must earn your own grades.