x:=-600000;
newsc(ea);
setfillstyle(1,2);
bar(170,120,490,360);
setcolor(14);
rectangle(175,125,485,355);
rectangle(177,127,483,353);
settextstyle(0,0,0);
setfillstyle(1,1);
bar(180,170,480,190);
if ea mod 2 =0 then
begin
outtextxy(180,135,Функция распознана.Интеграл подсчитан.');
outtextxy(180,180,' Посмотреть значение интеграла');
outtextxy(180,210,'Посмотреть коэффициенты Ньютона-Котеса');
outtextxy(180,240,' Посмотреть значения функции');
outtextxy(180,270,' Посмотреть график' );
outtextxy(180,300,' Считать снова');
outtextxy(180,330,' Выход ');
end
else
outtextxy(180,135,'Function Indentified.Integral counted.');
outtextxy(180,180,' View value of integral');
outtextxy(180,210,' View Newton-Cotes coefficients');
outtextxy(180,240,' Veiw values of function');
outtextxy(180,270,' View graphik ' );
outtextxy(180,300,' Count again');
outtextxy(180,330,' Exit ');
end;
repeat
if keypressed then
c:=readkey;
case c of
#80:
x:=x-1;
#72:
x:=x+1;
case (abs(x) mod 6) of
0:
bar(180,200,480,220);
bar(180,320,480,340);
1:
bar(180,230,480,250);
2:
bar(180,260,480,280);
3:
bar(180,290,480,310);
4:
5:
outtextxy(180,135,'Функция распознана.Интеграл подсчитан.');
outtextxy(180,270,' Посмотреть график ' );
until c=#13;
c:='t';
0:begin
setcolor(15);
setfillstyle(1,12);
bar(140,200,490,280);
rectangle(145,205,485,275);
rectangle(147,207,483,273);
settextstyle(2,0,1);
setusercharsize(1,1,5,1);
outtextxy(170,210,'S');
settextstyle(2,0,4);
str(a:3:3,p);
outtextxy(160,257,p);
str(b:3:3,p);
outtextxy(160,212,p);
settextstyle(3,0,2);
outtextxy(180,224,f);
p:='';
str(abs(int):7:3,p);
outtextxy(190+length(f)*12,224,p);
readln;
bar(170,120,490,180+n*15);
rectangle(175,125,485,175+n*15);
rectangle(177,127,483,173+n*15);
outtextxy(180,130,'Коэффициенты Ньютона-Котеса:');
outtextxy(180,140+(n+1)*15,'Нажмите ENTER для продолжения');
outtextxy(180,130,'Newton-Cotes coefficients:');
outtextxy(180,140+(n+1)*15,'Press ENTER to continue');
hkoef(n,h);
for i:=0 to n do
str(i,p);str(h[i]:2:4,p1);
p:='H'+p+' = '+p1;
outtextxy(180,140+i*15,p);
2:begin
outtextxy(180,130,'Значения функции:');
outtextxy(180,130,'Values of function:');
str(i,p);str(y[i]:2:4,p1);
p:='Y'+p+' = '+p1;
p1:='';
str((a+i*(b-a)/n):2:4,p1);
str(i,p);
if ea mod 2 = 0 then
p:=',При '+'X'+p+' = '+p1
p:=',When '+'X'+p+' = '+p1;
outtextxy(285,140+i*15,p);
graphik(ea,a,b,f);
closegraph;
halt;
until (abs(x) mod 6)=4;
k:=abs(x) mod 6;
end.
================================================
========МОДУЛЬ GRAPHIC========
unit graphic;
interface
uses
k_unit,crt,graph;
procedure hwg(ea:word);
procedure graphik(ea:word;a,b:real;f1:string);
implementation
{Процедура окна помощи при графике}
var
f:string;
setfillstyle(1,3);
bar(150,100,390,380);
setcolor(0);
rectangle(153,103,387,377);
rectangle(155,105,385,375);
outtextxy(160,115,' ОКНО ПОМОЩИ');
outtextxy(160,140,' Для работы с графиком');
outtextxy(160,155,' используйте клавиши:');
outtextxy(160,180,' PAGE UP-первоначальный');
outtextxy(160,195,' вид графика;');
outtextxy(160,210,' HOME-начальный масштаб;');
outtextxy(160,225,' INSERT-включить/выключеть');
outtextxy(160,240,' заливку области;');
outtextxy(160,255,' DELETE-включить/выключеть');
outtextxy(160,270,' сетку;');
outtextxy(160,285,' END-показать/убрать цифры');
outtextxy(160,300,' F1- Помощь;');
outtextxy(160,315,' Стрелки ВВЕРХ/ВНИЗ- ');
outtextxy(160,330,' увеличение/уменьшение');
outtextxy(160,345,' масштаб .');
outtextxy(160,360,'Для возрата нажмите ENTER.');
outtextxy(160,115,' HELP WINDOW');
outtextxy(160,140,' For the work with graphic');
outtextxy(160,155,' use this keys:');
outtextxy(160,180,' PAGE UP-Primery form of');
outtextxy(160,195,' graphik;');
outtextxy(160,210,' HOME-Primery scale;');
outtextxy(160,225,' INSERT-Turn on/off inking');
outtextxy(160,240,' the field;');
outtextxy(160,255,' DELETE-Turn on/off the');
outtextxy(160,270,' net;');
outtextxy(160,285,' END-View/delete the figures');
outtextxy(160,300,' F1- Help;');
outtextxy(160,315,' Arrows UP/DOWN-Increase/ ');
outtextxy(160,330,' lower the scale;');
outtextxy(160,360,'Press ENTER to continue.');
Страницы: 1, 2, 3, 4, 5, 6