.


:




:

































 

 

 

 





1) Borland C++ Builder.

2)

U_work1. File Save As , . .

3) Standard, -

. Panel (), , . , .

Form1

. Panel1.

4) Panel1

Panel2.

5) Panel1:

Label (Label1-Label3);

Edit (Edit1-Edit3);

Button (Button1, Button2).

Panel2:

Label (Label4-Label7);

Edit (Edit4, Edit5);

Button (Button3).

7) Panel1. Caption (, ) . Panel2.

 

 

8) Label1

Caption ( ) 1.

Label2 Y1.

Label3 .

9) Name Button1

Umn_But. , , . , .

( Caption) -

.

10) Button2 Div_But, .

11) Button3 Calc_But, -

.

12) 8 Label4,

Label5, Label6. 2, Y2 -

.

13) Label7. -

.

( Name) Res_Lab.

14) Edit1 X1_Edit ( Name), -

Text ( ).

Text Edit2, Edit3, Edit4

Edit5.

Edit2 Y1_Edit, Edit3

Res_Edit, Edit4 X2_Edit, Edit5

Y2_edit.

15) .

16) ,

. , .

, Pane1,

. X1_Edit X, Y1_Edit

Y. Res_Edit, , .

. -

X*Y, Res_Edit. X/Y, Res_Edit.

17) . -

U_work1.h. public TMainForm double:

double X; // X

double Y; // Y

double Result; //

,

.. TMainForm(TComponent* Owner).

18) .

(Object Inspector) Umn_But (.. ). Events, .

OnClick

. Umn_ButClick. Unit1.cpp , :

void __fastcall TMainForm::Umn_ButClick(TObject *Sender)

{

}

, ..

.

19) X Y , X1_Edit Y1_Edit. , , . double , , StrToFloat(AnsiString S):

X = StrToFloat(X1_Edit>Text);

Y = StrToFloat(Y1_Edit>Text);

20) Result

X*Y, Result Res_Edit.

Text

Res_Edit Result, double AnsiString FloatToStr(double Value):

Result = X*Y;

Res_Edit>Text = FloatToStr(Result);

21) .

22) . :

Result = X/Y;

Res_Edit>Text = FloatToStr(Result);

23) -

Y 0 . Y if :

if (Y == 0) // Y 0

{//

Application>MessageBoxA( 0!, , MB_OK);

return; //

}

Y = 0 , 1.8. OK, return. , .. , ( void).

24) . X Y , Panel2.

Res_Lab.

Caption ( AnsiSting) Res_Lab>Caption.

, .

:

//---------------------------------------------------------------------------

 

void __fastcall TMainForm::Calc_butClick(TObject *Sender)

{

X = StrToFloat(X2_Edit->Text);

Y = StrToFloat(Y2_Edit->Text);

Result = (Y+(2*X))/((5*X)+(Y*Y));//

Res_Lab->Caption = FloatToStr(Result);

}

//---------------------------------------------------------------------------

25) :


 

, :

Ø Borland C++ Builder ;

Ø , ;

Ø , , . 8 , ;

Ø .(*);

Ø ( #_ _);

Ø C++ , , , , . , , .

, , (, );

Ø .

 

:

1.. ++.

2. - C++.

3. - ++.

4. - C++. .

5. . - C++

 





:


: 2015-11-23; !; : 424 |


:

:

, ,
==> ...

1512 - | 1437 -


© 2015-2024 lektsii.org - -

: 0.02 .