ssid (TForm3), & Form3);
Application-> Run ();
}
catch (Exception & exception)
{
Application-> ShowException (& exception);
}
return 0;
}
// --------------------------------------------- ------------------------------
В
Unit1.cpp
// --------------------------------------------- ------------------------------
# include
# include
# include
# pragma hdrstop
# include "Unit1.h"
# include "Unit2.h"
# include "Unit3.h"
# include
// --------------------------------------------- ------------------------------
# pragma package (smart_init)
# pragma resource "*. dfm"
TForm1 * Form1;
float a = 0, b = 10, e = 0.01, I [2];
float f (float x)
{
return 5 * pow (x, 5)-pow (x, 3);
}
// -------------------------------------
void Bool ()
{
float h, s, x [5], N = 2;
int i, l;
do
{
for (l = 0; l <= 1; l + +)
{
s = 0;
h = (b-a)/N;
x [0] = a;
x [1] = a + h/4;
x [2] = a + h/2;
x [3] = a +3 * h/4;
x [4] = a + h;
for (i = 1; i <= N; i + +)
{
s = (7 * f (x [0]) +32 * f (x [1]) +12 * f (x [2]) +32 * f (x [3]) +7 * f (x [4 ])) + s;
x [0] + = h;
x [1] + = h;
x [2] + = h;
x [3] + = h;
x [4] + = h;
}
I [l] = h * s/45/2;
N = N * 2;
}
} while (fabs (I [0]-I [1])> e);
}
// --------------------------------------------- ------------------------------
__fastcall TForm1 :: TForm1 (TComponent * Owner)
: TForm (Owner)
{
}
// --------------------------------------------- ------------------------------
void __ fastcall TForm1 :: Exit1Click (TObject * Sender)
{
Close ();
}
// --------------------------------------------- ------------------------------
void __ fastcall TForm1 :: Exit2Click (TObject * Sender)
{
Close ();
}
// --------------------------------------------- ------------------------------
void __ fastcall TForm1 :: Exit1pop (TObject * Sender, TCanvas * ACanvas,
TRect & ARect, bool Selected)
{
SB1-> SimpleText = "Вихід";
}
// --------------------------------------------- ------------------------------
void __ fastcall TForm1 :: N1Click (TObject * Sender)
{
Form2-> Show ();
SB1-> SimpleText = "Введення даних закінчений";
}
// --------------------------------------------- ------------------------------