помогите исправить код на delphi

var
w,a,b,c,x: real;
//i:byte;
begin
a:=strtofloat(edit1.Text);
b:=strtofloat(edit2.text);
c:=strtofloat(edit3.text);
x:=strtofloat(edit4.Text);
if (x>2) and (x<1) then
memo1.lines.add('X должен быть не менее 1 и не более 2')
else repeat
begin
if (x>=1) and (x<1.2) then
W:=a*sqr(x)+b*x+c
else if (x=1.2) then
W:=a/x+sqrt(sqr(x)+1)
else if (x>1.2) and (x<2.05) then
W:=(a+b*x)/sqrt(sqr(x)+1);
memo1.lines.add('x       W');
memo1.lines.add(floattostrf(x,fffixed,8,3)+'    '+floattostrf(w,fffixed,8,3));
x:=x+0.05;
end;
until (x>2.05);
end;

код на делфи работает, но все равно считает при значеениях х меньше 1 и больше 2


Ответы (0 шт):