C++ Builder 6.
. ().
, , , .
Windows Clipboard, .
.
, .
, , ..
, , , ..
, , .
.
, : , , .. , , .
, .
, C++Builder .
C++Builder , , - - . . , .
. ( ) , . . , .
, . , .
: , ( ). . , . , . . , .
|
|
z=f(x,y)
1. ( Windows) _1 C++Builder 6.
2. | | .
3. | . . C++Builder , . .cpp , . , Formula, PR_Formula. | ( ).
4. , Caption (). Form1 Caption . , .
5. Button . ( ). - . ( ) . -, . , , , . , C++Builder Button1. - . ( - , .. . . Delete.) Caption (), Button1, . Height () 30. Font (), Height () 20, Style () true fsBold (). , . .
6. Panel1. . , , , Caption . 30. , BevelInner BevelOuter, ( bvLowered bvRaised) . BevelInner = bvLowered BevelOuter = bvRaised.
7. Label1 ( ). , 30.
|
|
8. LabeledEdit, . LabeledEdit X Y . + EditLabel Caption X Y . 20. Text 1,3 5, 6 , 25.
9. , , , Label2, Caption , .
10. , . , (), ( ) OnClick ( ) . . OnClick ( ) : . , (TForm1), (Button1) On (Click). , . , ():
void __fastcall TForm1::Button1Click(TObject *Sender)
{
double x,y,z;
x=StrToFloat(LabeledEdit1->Text);
y=StrToFloat(LabeledEdit2->Text);
z=(exp(x*x+2.37)-pow(x,1.5))/sqrt(fabs(y*y*y+atan2(y,x)));
Panel1->Caption="z="+FloatToStr(z);
}
11. Formula.h #include <math.h>. .
12. | , F9. , , . , . , . .
13. . FloatToStrF :
System::AnsiString FloatToStrF(Extended Value,
TFloatFormat Format, int Precision, int Digits).
Value TFloatFormat : enum TFloatFormat{ffGeneral, ffExponent, ffFixed, ffNumber, ffCurrency};
:
ffGeneral | . , . , . , Precision 0.00001. , Digits 0 4 |
ffExponent | . d.ddd...E+dddd. , , Precision. E + . Digits 0 4 |
ffFixed | . ddd.ddd.... . Digits, 0 18. Precision, |
|
|
:
Panel1->Caption="z="+FloatToStrF(z,ffExponent,5,2);
. ( !) , . ffGeneral ffFixed.
14. C++Builder.