var
x,y:real;
begin
x:=-2;
while x<=3 do
if x < 0 then
y:=x+1;
writeln('y=',y,' x=',x)
end;
if x>2.0 then
y:=(2.5*power(x,3))+(6*power(x,2))-30;
if (x <= 3.5) and (x >= 1.5) then
y:=x+3;
x:=x+0.5;
end.
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var
x,y:real;
begin
x:=-2;
while x<=3 do
begin
if x < 0 then
begin
y:=x+1;
writeln('y=',y,' x=',x)
end;
if x>2.0 then
begin
y:=(2.5*power(x,3))+(6*power(x,2))-30;
writeln('y=',y,' x=',x)
end;
if (x <= 3.5) and (x >= 1.5) then
begin
y:=x+3;
writeln('y=',y,' x=',x)
end;
x:=x+0.5;
end;
end.