Рефераты. Вычисление интеграла методом Ньютона-Котеса (теория и программа на Паскале)

rectangle(353,103,587,377);

rectangle(355,105,585,375);

setcolor(14);

if (ea mod 2)=0 then

outtextxy(360,115,' ОКНО ПОМОЩИ')

else

outtextxy(360,115,' HELP WINDOW');

end;

procedure error1(ea:word);

begin

setcolor(15);

setfillstyle(1,12);

bar(140,210,490,280);

rectangle(145,215,485,275);

rectangle(147,217,483,273);

if (ea mod 2)=0 then

begin

outtextxy(150,227,' Ошибка! ');

outtextxy(150,237,' Вводимые параметр не число!! ');

outtextxy(150,250,' Проверьте значение и заново введите его.');

end

else

begin

outtextxy(150,227,' Error! ');

outtextxy(150,237,' The value you entered isn`t a quantity!!');

outtextxy(150,250,' Check it and put it in again. ');

end;

sound(600);

delay(4000);

nosound;

readln;

readln;

end;

procedure error(ea:word);

{Процедура ошибки}

begin

setcolor(15);

setfillstyle(1,12);

bar(140,210,490,260);

rectangle(145,215,485,255);

rectangle(147,217,483,253);

if (ea mod 2)=0 then

begin

outtextxy(150,227,' Ошибка!');

outtextxy(150,237,' Недостаток вводимых параметров!!');

end

else

begin

outtextxy(150,227,' Error!');

outtextxy(150,237,' Not all parameters are set!');

end;

sound(600);

delay(4000);

nosound;

readln;

end;

procedure newsctext(ea:word);

{Текст для процедуры newsc}

begin

if ea mod 2 =0 then

begin

settextstyle(0,0,1);

setcolor(15);

outtextxy(400,440,'Язык - Русский. ');

outtextxy(400,450,'Версия 1.0 Последнее издание');

outtextxy(400,460,'й Все права защищены.');

end

else

begin

settextstyle(0,0,1);

setcolor(15);

outtextxy(400,440,'Language - English.');

outtextxy(400,450,'Version 1.0 Final release.');

outtextxy(400,460,'й All rights reserved.');

end;

end;

procedure newsc(ea:word);

{Процедура обновления экрана}

begin

cleardevice;

setfillstyle(10,8);

floodfill(1,1,15);

setcolor(0);

setfillstyle(1,7);

bar(80,10,580,80);

rectangle(82,12,578,78);

rectangle(85,15,575,75);

settextstyle(0,0,2);

setcolor(10);

if ea mod 2 =0 then

begin

settextstyle(0,0,2);

outtextxy(90,20,' Вычисление интеграл ');

outtextxy(90,50,' методом Ньютона-Котеса.');

newsctext(ea);

end

else

begin

settextstyle(3,0,2);

outtextxy(90,20,' Calculeting of integral');

outtextxy(90,47,' using the Newton-Cotes method.');

newsctext(ea);

end;

settextstyle(0,0,1);

end;

procedure winwin1;

{Окно процедуры win1}

begin

setfillstyle(1,7);

bar(160,110,460,380);

setcolor(0);

rectangle(162,113,457,377);

rectangle(165,115,455,375);

end;

procedure win1(ea:word);

{Вводное окно}

begin

settextstyle(0,0,1);

setcolor(10);

if (ea mod 2)=0 then

begin

outtextxy(168,135,'Министерство Высшего образования РФ);

outtextxy(168,150,'Московский Государственный Институт');

outtextxy(168,160,' Электронной Техники ');

outtextxy(168,170,' (Технический лниверситет) ');

outtextxy(168,180,' Лицей №1557 ');

outtextxy(168,210,' КУРСОВАЯ РАБО'А ');

outtextxy(168,230,' «Вычисление интеграла ');

outtextxy(168,245,' метедом Ньютона-Котеса» ');

outtextxy(158,270,' Написал: Коноплев А.А. ');

outtextxy(158,285,' Руководитель: доцент Колдаев В.Д.');

end

else

begin

outtextxy(168,135,' Department of High Education ');

outtextxy(168,150,' Moscow State Institute of ');

outtextxy(168,160,' Electronic Technics ');

outtextxy(168,170,' (Technics University) ');

outtextxy(168,180,' Lyceum №1557 ');

outtextxy(168,210,' COURSE WORK ');

outtextxy(168,230,' «Calculation of integral ');

outtextxy(168,245,' by Newton-Cotes method» ');

outtextxy(158,270,' Author: Konoplev A.A. ');

outtextxy(158,285,' Supervisor:senior lecturer ');

outtextxy(158,300,' Koldaev V.D. ');

end;

end;

procedure win2(ea:word;var k:word);

{Окно выбора способа подсчета }

var

c:char;

x:integer;

f:string;

begin

setcolor(2);

setfillstyle(1,5);

bar(70,200,340,330);

rectangle(75,205,335,325);

rectangle(77,207,333,323);

settextstyle(0,0,0);

setfillstyle(1,15);

bar(80,250,330,270);

setfillstyle(1,5);

bar(80,285,330,305);

if ea mod 2 =0 then

begin

outtextxy(77,220,'Выбирете способ задания значений');

outtextxy(75,230,' функции. ');

outtextxy(70,255,' По таблице(в ручную)');

outtextxy(70,295,' По расчетам(автом т.)');

end

else

begin

outtextxy(77,220,' Choose a method of putting in');

outtextxy(75,230,' the values of function. ');

outtextxy(70,255,' By the table(by hand)');

outtextxy(70,295,' By calculations(automat.)');

end;

helpwin(ea);

if ea mod 2 =0 then

begin

outtextxy(360,140,'В этом способе необходимо');

outtextxy(360,155,'самостоятельно вводить');

outtextxy(360,170,'значения функции.');

end

else

begin

outtextxy(360,140,'In this method you have');

outtextxy(360,155,'to put in values of ');

outtextxy(360,170,'function by yourself.');

end;

x:=0;

repeat

if keypressed then

begin

c:=readkey;

if (c=#80) or (c=#72) then

x:=x+1;

setfillstyle(1,15);

if (x mod 2)=0 then

begin

bar(80,250,330,270);

setfillstyle(1,5);

bar(80,285,330,305);

helpwin(ea);

if ea mod 2 =0 then

begin

outtextxy(360,140,'В этом способе необходимо');

outtextxy(360,155,'самостоятельно вводить');

outtextxy(360,170,'значения функции.');

end

else

begin

outtextxy(360,140,'In this method you have');

outtextxy(360,155,'to put in values of ');

outtextxy(360,170,'function by yourself.');

end;

end

else

begin

bar(80,285,330,305);

setfillstyle(1,5);

bar(80,250,330,270);

helpwin(ea);

if ea mod 2 =0 then

begin

outtextxy(360,140,'В этом способе компьютер');

outtextxy(360,155,'сам вычесляет значения');

outtextxy(360,170,'функции по вводимой функции.');

end

else

begin

outtextxy(360,140,'In this method PC will');

outtextxy(360,155,'automaticly count the value');

outtextxy(360,170,'of function by the function');

outtextxy(360,185,'you enter ');

end;

end;

setcolor(2);

if ea mod 2 =0 then

begin

outtextxy(70,255,' По таблице(в ручную)');

outtextxy(70,295,' По расчетам(автом т.)');

end

else

begin

outtextxy(70,255,' By the table(by hand)');

outtextxy(70,295,' By calculations(automat.)');

end;

end;

until c=#13;

k:=x mod 2;

end;

procedure wwod1(ea:word;var y:array of double;var n:integer;var a,b:real);

{Окно ручного ввода функции}

var

i,p:integer;

s,f:string;

p1:real;

c:char;

begin

wwodn(ea,n);

if n=0 then

wwodn(ea,n);

newsc(ea);

wwodab(ea,a,b);

helpwin(ea);

if ea mod 2 =0 then

begin

outtextxy(360,140,'В этом окне необходимо');

outtextxy(360,155,'постепенно вводить');

outtextxy(360,170,'значения функции.');

outtextxy(360,185,'после каждого ввода');

outtextxy(360,200,'определенного значения');

outtextxy(360,215,'нажмите ENTER.');

end

else

begin

outtextxy(360,140,'In this window you have');

outtextxy(360,155,'to gradually enter the');

outtextxy(360,170,'values of functions.');

outtextxy(360,185,'After each enter press');

outtextxy(360,200,'ENTER key.');

end;

Страницы: 1, 2, 3, 4, 5, 6



2012 © Все права защищены
При использовании материалов активная ссылка на источник обязательна.