Курсовая работа: Отыскание корня уравнения методом половинного деления
LOCATE 1, 15
PRINT "Kursovaya rabota po informatike OTLADKA"
LOCATE 2, 18
PRINT "Gruppa PS0601, Kudlo Alexey"
LOCATE 4, 10
afix = 0: bfix = 3: E = .001
PRINT TAB(14); "Znacheniya f(x) na [a;b]"
PRINT TAB(19); "x f(x)"
FOR i = 0 TO 10
PRINT USING " ##.### ##.####"; i * .3; integr(0, i * .3, .0001)
NEXT i
xx = uravn(afix, bfix, E)
PRINT TAB(5); "Iskomij koren` x*="; xx; " bil najden s tochnost`ju E="; E
END
FUNCTION fint (t)
fint = 1
END FUNCTION
FUNCTION integr (afix, x, E)
aint = afix: bint = x
nint = 2: h = (bint - aint) / 2: s = (fint(aint) + 4 * fint((aint + bint) / 2) + fint(bint)) * (h / 3)
DO
nint = 2 * nint: h = (bint - aint) / nint: s1 = s: cin = 4: x = aint: s = fint(aint) + fint(bint)
FOR i = 1 TO nint - 1
x = x + h: s = s + cin * fint(x): cin = 6 - cin
NEXT i
s = s * h / 3
LOOP UNTIL ABS(s - s1) < E
x = bint