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

end; if (ea mod 2) =0 then begin outtextxy(255,267,'ДА'); outtextxy(325,267,'НЕТ'); end else begin outtextxy(255,267,'YES'); outtextxy(325,267,'NO'); end; until c=#13; if abs(x mod 2)=1 then begin n:=0; setcolor(15); setfillstyle(1,2); bar(160,200,460,280); rectangle(165,205,455,275); rectangle(167,207,453,273); if (ea mod 2)=0 then begin outtextxy(180,227,'Для работы программы необходимо'); outtextxy(180,237,' заново ввести N.'); outtextxy(180,247,' Нажмите ENTER для продолжения.'); end else begin outtextxy(180,227,' To continue you have to '); outtextxy(180,237,' again put in N. '); outtextxy(180,247,' Press ENTER to continue.'); end; readln; readln; end; end; until n>0; end;

procedure winwwodab(ea:word);
{Окно ввода приделов интегрирования} var f:string; begin helpwin(ea); if (ea mod 2)=0 then begin outtextxy(360,140,' В этом окне необходимо'); outtextxy(360,155,' ввести сначала нижнее'); outtextxy(360,170,' значение интеграл и нажать'); outtextxy(360,185,' ENTER, а затем ввести'); outtextxy(360,200,' верхнее значение интеграла'); outtextxy(360,215,' и снова нажать ENTER.'); end else begin outtextxy(360,140,' In this window you have to:'); outtextxy(360,155,'firstly, put in lower value '); outtextxy(360,170,'of integral and press ENTER,'); outtextxy(360,185,'then put in higher value'); outtextxy(360,200,'of integral and press ENTER'); end; setcolor(2); setfillstyle(1,5); bar(10,210,335,320); rectangle(15,215,330,315); rectangle(17,217,328,313); settextstyle(0,0,0); if (ea mod 2)=0 then begin outtextxy(20,230,' Введите нижнее значение'); outtextxy(20,244,' интеграл :'); outtextxy(20,262,' Введите верхнее значение'); outtextxy(20,272,'интеграл :'); end else begin outtextxy(20,230,' Put in lower value of'); outtextxy(20,244,' integral:'); outtextxy(20,262,' Put in higher value of'); outtextxy(20,272,'integral:'); end; end; procedure wwodab(ea:word;var a,b:real);
{Процедура ввода приделов интегрирования} var f:string; k:string; ec:integer; begin newsc(ea); winwwodab(ea); readln; repeat winwwodab(ea); gotoxy(16,16); read(k); val(k,a,ec); if ec0 then error1(ea); until ec=0; readln; repeat winwwodab(ea); str(a:4:2,f); outtextxy(120,244,f); gotoxy(16,18); read(k); val(k,b,ec); if ec0 then error1(ea); until ec=0; end; procedure helpwin(ea:word);
{основа окна помощи} begin setfillstyle(1,3); bar(350,100,590,380); setcolor(0); 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; setfillstyle(1,9); bar(40,200,330,300); rectangle(45,205,325,295); rectangle(47,207,323,293); if ea mod 2 =0 then outtextxy(56,227,'Введите 0 -е значение финкции:') else outtextxy(56,227,' Enter 0 -th value of function:'); for i:=0 to n do begin setfillstyle(1,0); bar(137,250,180,273); gotoxy(19,17); setfillstyle(1,9); read(p1); y[i]:=p1; bar(120,227,134,240); str(i+1,s); outtextxy(120,227,s); bar(310,220,320,250); end;

end; procedure wwod2(ea:word;var ea1:word;var n:integer;var a,b:real;var st:string);
{Окно 2 меню автомат. подсчета} var i:integer; c,k:char; x:longint; f:string; begin repeat x:=-600000; if keypressed then c:=readkey; c:='t'; newsc(ea); setfillstyle(1,15); bar(70,120,342,330); setcolor(12); rectangle(75,125,337,325); rectangle(77,127,335,323); settextstyle(0,0,0); setfillstyle(1,11); bar(80,170,330,190); if ea mod 2 =0 then begin outtextxy(80,130,'Меню ввода параметров нахождения'); outtextxy(80,140,' интеграла'); outtextxy(80,180,' Ввести количество узлов(n)'); outtextxy(80,210,' Ввести приделы интегрирования'); outtextxy(80,240,' Ввести функцию'); outtextxy(80,270,' Считать интеграл'); outtextxy(80,300,' Выход '); end else begin outtextxy(80,130,'Menu of entering the parameters'); outtextxy(80,140,' of integral'); outtextxy(80,180,' Put in the number of units '); outtextxy(80,210,' Enter the bounds of integral'); outtextxy(80,240,' Enter function'); outtextxy(80,270,' Count integral'); outtextxy(80,300,' Exit '); end; helpwin(ea); if ea mod 2 =0 then begin outtextxy(360,140,' Нажмите Enter для'); outtextxy(360,155,' ввода количества узлов'); end else begin outtextxy(360,140,' Press Enter to put'); outtextxy(360,155,' in the number of units'); end; repeat if keypressed then begin c:=readkey; case c of

#80: x:=x-1;

#72: x:=x+1; end; setfillstyle(1,11); case (abs(x) mod 5) of

0: begin bar(80,170,330,190); setfillstyle(1,15); bar(80,200,330,220); bar(80,290,330,310); helpwin(ea); if ea mod 2 =0 then begin outtextxy(360,140,' Нажмите Enter для'); outtextxy(360,155,' ввода количества узлов'); end else begin outtextxy(360,140,' Press Enter to put'); outtextxy(360,155,'in the number of units.'); end; end;

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



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