Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Informatika_Voytushenko

.pdf
Скачиваний:
11
Добавлен:
24.02.2016
Размер:
5.38 Mб
Скачать

!. + ( 8.21) B ! ! -( &$ , ,). @ B– 5. -# -

# m n.

 

'

! B ,

 

! – General

Declaration ! .

@ ! ! # # - . @ ! : !.

# ! B ! : !! , :

z = z + ,(i,j) j = 1 m,

: z – B i – $ ,

,(i,j) – B i – $ m ! .

8.21 – H ! 8.13 – «* »

# ! B ! ! : !! !:

411

z = z + ,(i,j) i = 1 n,

: z – B j – n ! !. ' # # ! B, B

z # # ! = 0 . '-! .

' 8.12 " ! 8.12. – ' 8.13 «*»

Œ

 

 

/

 

 

1

2

3

1

* ! -

@ # #

 

!

, '! – -

 

-

$

 

 

:

 

 

! ! – n,

 

 

m,

 

 

! – S.

2

* ! -

$. . Tools . Menu Editor Caption

 

!

& *,

 

 

Name – '! & * (

 

 

8.20) Next Caption

 

 

^ ,, Name – '!

 

 

^ ! Enabled (

 

 

) Next

 

 

Caption !,

 

 

Name ! ! Enabled

 

 

Next -

 

 

, A

 

 

Caption – ,

 

 

Name _ Next

 

 

Caption -

 

 

– , Name

 

 

_ Next

 

 

Caption -

 

 

&$ ,, Name

 

 

& ! Enabled -

 

 

Next Caption -

 

 

,, Name ,.

412

$B ! 8.12.

1

2

3

3

' % ! -

, '-

 

 

: General ! Declaration,

 

 

:

 

 

Dim i, j As Integer

 

 

Dim ,() As Single

 

 

Dim z As Single

4

$ -

Private Sub n_Change()

 

 

If n.Text <> "" And m.Text <> "" Then

 

 

! .Enabled = True

 

 

 

 

-

^ .Enabled = True

 

 

& .Enabled = True

 

n

End If

 

 

End Sub

5

$ -

Private Sub m_Change()

 

-

If n.Text <> "" And m.Text <> "" Then

 

-

! .Enabled = True

 

 

^ .Enabled = True

 

m

& .Enabled = True

 

 

End If

 

 

End Sub

 

 

 

6

! -

$ ! , -

 

,

:

 

 

Private Sub ,_Click()

 

 

If MsgBox(" $ =_ $

 

 

* ?", vbYesNo) = vbYes_ Then End

 

 

‘ vbYesNo . ?; vbYes –

 

 

‘ «8 »

 

 

End Sub

7

! -

$ ! &$

 

&-

, -

 

$ ,

:

 

 

Private Sub &_Click()

 

 

Form1.Hide

 

 

S.Text = 0

 

 

For i = 1 To n

 

 

For j = 1 To m

 

 

S.Text = Val(S.Text) + ,( , j)

 

 

Next j

 

 

Next

 

 

MsgBox ("& * -_ "

 

 

& S.Text)

 

 

Form1.Show

 

 

End Sub

 

 

 

413

$B ! 8.12.

1

2

3

8

!

Private Sub Y_Click()

 

Y

n.Text = ""

 

 

m.Text = ""

 

 

S.Text = ""

 

 

! .Enabled = False

 

 

^ .Enabled = False

 

 

& .Enabled = False

 

 

End Sub

9

* ! B

$. . Project . Add Form '!

 

! -

F& * Caption

 

& *

& *

 

 

!

 

 

: Multiline True ( ! ! -

 

 

! ), Enabled False ( ! -

 

 

), Text

 

 

, ! % Enter

 

 

 

 

 

5

 

 

 

10

* ! -

Private Sub Command1_Click()

 

!

F& * .Hide

 

5 & -

Form1.Show

 

*

End Sub

11

* ! B

$. . Project . Add Form '!

 

! -

F^ Caption

 

^ ,

^ ,

 

 

5 !

 

 

5 :

 

 

Private Sub Command1_Click()

 

 

F^ .Hide

 

 

Form1.Show

 

 

End Sub

414

$B ! 8.12.

1

2

3

12

* !

$. . Project . Add Form '!

 

B !

F_ (F_) Caption

 

 

& = ( )

 

 

5 -

 

 

! 5 :

 

 

Private Sub Command1_Click()

 

 

F_.Hide

 

 

Form1.Show

 

 

End Sub

 

 

(Private Sub Command1_Click()

 

 

F_.Hide

 

 

Form1.Show

 

 

End Sub)

13

! -

$ ! & *

 

 

:

 

& *

Private Sub & *_Click()

 

 

F& * .Show

 

 

Form1.Hide

 

 

End Sub

14

! -

$ ! -

 

 

, -

 

^ ,

:

 

 

Private Sub ^_Click()

 

 

ReDim ,(n, m)

 

 

Form1.Hide

 

 

F^ .Show

 

 

F^ .Cls

 

 

F^ .Print “; “, “_ K$ -

 

 

”, “ ”

 

 

For = 1 To n

 

 

For j = 1 To m

 

 

,( , j) = InputBox(“^ _ =

 

 

“ & Str( ) & “ “ & Str(j)_ & “ -

 

 

$%”)

 

 

F^ .Print ; Tab(24); j; Tab(50); ,( , j)

 

 

Next j

 

 

Next i

 

 

End Sub

15

! -

. ( ! -

 

 

!

 

 

:

415

$B ! 8.12.

1

2

3

 

 

 

Private Sub _ _Click()

 

 

 

Form1.Hide

 

 

 

F_.Show

 

 

 

F_.Cls

 

 

 

S.Text = 0

 

 

 

For i = 1 To Val(n.Text)

 

 

 

z = 0

 

 

 

For j = 1 To Val(m.Text)

 

 

 

z = z + ,( , j)

 

 

 

Next j

 

 

 

F_.Print “ * “; ; “_

 

 

”, z

 

 

 

S.Text = Val(S.Text) + z

 

 

 

Next

 

 

 

F_.Print „--------------------------------------

 

 

 

----------------------------„

 

 

 

F_.Print Tab(24); “' : “; Tab(43); S

 

 

End Sub

 

16

! -

$ ! -

 

 

-

 

 

:

 

 

 

Private Sub _ _Click()

 

 

 

Form1.Hide

 

 

 

F_.Show

 

 

 

F_.Cls

 

 

 

S.Text = 0

 

 

 

For j = 1 To Val(m.Text)

 

 

 

z = 0

 

 

 

For = 1 To Val(n.Text)

 

 

 

z = z + ,( , j)

 

 

 

Next

 

 

 

F_.Print " *_

";

 

 

j; " $%", z

 

 

 

S.Text = Val(S.Text) + z

 

 

 

Next j

 

 

 

F_.Print "----------------------------------

_

 

 

-----------------------------------------------"

 

 

 

F_.Print Tab(24); "' : ";_

 

 

 

Tab(57); S

 

 

 

End Sub

 

416

$B ! 8.12.

1

2

3

17

 

* '! «$ -

 

'!

.

 

« $

 

 

 

+ # :

Printer.Print " * "; i; " ", z

! B -! .

@ ! ! % %B , A '! ! !# ': . @ ! BPicture ': :

LoadPicture (« % ! # »)

< ! A % ! , A # % -, %, , Path, ! # ! % !-# ! App.Path ( ': App – ): Path = App.Path.

$ 8.14. – B !': Picture B , B# - % : Y, n m ( ! MouseMove).$ 8.22 – 8.24.

417

8.22 – B B# % -Y

8.23 – B B# % -^ $

8.24 – B B# % -^

418

!.

" ! 8.13 – @ B8.13 – «* »

Œ

 

 

 

 

/

 

 

 

 

1

2

 

3

 

1

' % !

Dim i, j As Integer

 

 

 

Dim p() As Single

 

 

 

 

Dim z As Single

 

 

 

 

Dim Path, PName As String

2

!

Private Sub Form_Load()

 

 

% !

 

Path = App.Path

 

 

 

 

End Sub

 

3

B !

Private Sub Form_MouseMove(Button As_

 

!-

Integer, Shift As Integer, X As Single, Y As_

 

B# %

Single)

 

 

 

If PName <> "bd06135_.wmf" Then

 

 

 

Picture1.Picture = LoadPicture(Path +_

 

 

 

"\bd06135_.wmf")

 

 

 

 

PName = "bd06135_.wmf"

 

 

 

 

End If

 

 

 

 

End Sub

 

 

B !

Private Sub Y_MouseMove(Button

4

!

B-

As_ Integer, Shift As Integer, X As Single,_

 

# %

Y As_ Single)

 

 

Y.

If PName <> "itrash.gif" Then

 

 

 

 

Picture1.Picture = LoadPicture(Path +_

 

 

 

"\itrash.gif")

 

 

 

 

PName = "itrash.gif"

 

 

 

 

End If

 

 

 

 

End Sub

 

5

B !

Private Sub n_MouseMove(Button As_

 

!

B-

Integer,_ Shift As Integer, X As Single, Y_

 

# % -

As Single)

 

 

n

If PName <> "bs01072_.wmf" Then

 

 

 

Picture1.Picture = LoadPicture(Path +_

 

 

 

"\bs01072_.wmf")

 

 

 

 

PName = "bs01072_.wmf"

 

 

 

 

End If

 

 

 

 

End Sub

 

419

$B ! 8.13.

1

2

3

6

B !

Private Sub m_MouseMove(Button As_

 

! B-

Integer, Shift As Integer, X As Single, Y As_

 

# % -

Single)

 

m

If PName <> "so02253_.wmf" Then

 

 

Picture1.Picture = LoadPicture(Path +_

 

 

"\so02253_.wmf")

 

 

PName = "so02253_.wmf"

 

 

End If

 

 

End Sub

$ – B ! ! B# % ! ': , A! . Š , - B ! , !: ! ! -IF.

& $ $*

1.+ # B ! ! # ?

2.\ : ! # ?

3.\ ! : , # : - B !?

4. Š '! !: ! ! -# ?

5.\ ! # B ?

6.Š : ! ?

7.Š , A ?

8.J ! # ! y = n! @ ! # ! n -# !.

9.* # ! F = i2 , i = 1 n, #-

 

! i, i2, F.

 

10.

J

B ! #

 

 

# ! ( ) B -

 

# ( ).

11.

# ! * B B -

 

, B , , -

, ! A (Ki) (Ci) B -.

420

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]