1, Private Sub Command1_Click()
Const n% = 3
Dim P(1 To n%) As Single
Dim s, d, max As Single
Debug.Print " Прибутки підприємств "
For i% = 1 To n%
Title$ = "Прибуток підприємства "
Prt$ = "Введіть прибуток " & i% & "-го підприємства"
P(i%) = Val(InputBox(Prt$, Title$))
Debug.Print P(i%); " ";
Next i%
Debug.Print
max = P(1)
For i% = 1 To n%
If P(i%) > max Then
max = P(i%)
End If
Next i%
Debug.Print
Debug.Print "Найбільший прибуток "; Format(max, " ####.###"); "грн."
End Sub
2, Private Sub Command1_Click()
Const n% = 4
Dim P(1 To n%) As Single
Dim a, b, c, d, sum1, sum2 As Single
Debug.Print " Øòðàôè "
For i% = 1 To n%
Title$ = " Øòðàôè ô³ðì "
Prt$ = "Ââåä³òü ñóìó " & i% & "-ãî øòðàôó"
P(i%) = Val(InputBox(Prt$, Title$))
Debug.Print P(i%); " ";
Next i%
Debug.Print
For i% = 1 To n%
sum1 = P(1) + P(2)
sum2 = P(3) + P(4)
Next i%
Debug.Print
Debug.Print "Ñóìà äâîõ ïåðøèõ="; Format(sum1, " ####.###")
Debug.Print "Ñóìà äâîõ îñòàíí³õ="; Format(sum2, " ####.###")
End Sub
3. Private Sub Command1_Click()
Dim T, B, A, Z As Single
T = Val(Text1.Text)
B = Val(Text2.Text)
A = Val(Text3.Text)
If (T * B) <= A Then
Z = 0
Else
Z = T * B - A
End If
Text4.Text = Str(Z)
End Sub
4, Private Sub Command1_Click()
Const n% = 3
Dim P(1 To n%) As Single
Dim s, d, max As Single
Debug.Print " Перерахунки фірми "
For i% = 1 To n%
Title$ = " Перерахунки фірми "
Prt$ = "Перерахунок №" & i% & ""
P(i%) = Val(InputBox(Prt$, Title$))
Debug.Print P(i%); " ";
Next i%
Debug.Print
Min = P(1)
For i% = 1 To n%
If P(i%) < Min Then
max = P(i%)
End If
Next i%
Debug.Print
Debug.Print "Найменший перерахунок="; Format(Min, " ####.###")
End Sub
5, Private Sub Command1_Click()
Const n% = 4
Dim P(1 To n%) As Single
Dim cred As Single
Debug.Print " Сальдо "
For i% = 1 To n%
Title$ = " Сальдо "
Prt$ = "Введіть суму " & i% & "-го сальдо"
P(i%) = Val(InputBox(Prt$, Title$))
Debug.Print P(i%); " ";
Next i%
Debug.Print
For i% = 1 To n%
If P(i%) < 0 Then
cred = P(i%)
Debug.Print "кредитове сальдо= "; Format(cred, " ####.###")
End If
Next i%
End Sub
7, Private Sub Command1_Click()
Const n% = 4
Dim P(1 To n%) As Single
Dim sum As Single
Debug.Print " Ñàëüäî "
For i% = 1 To n%
Title$ = " Ñàëüäî "
Prt$ = "Ââåä³òü ñóìó " & i% & "-ãî ñàëüäî"
P(i%) = Val(InputBox(Prt$, Title$))
Debug.Print P(i%); " ";
Next i%
Debug.Print
sum = 0
For i% = 1 To n%
If P(i%) < 0 Then
sum = sum + P(i%)
Debug.Print "êðåäèòîâå ñàëüäî= "; Format(cred, " ####.###")
End If
Next i%
End Sub