Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Public Class Form1
- Function mvvod(ByVal t As TextBox)
- Return Val(t.Text)
- End Function
- Function sa(ByVal x As Double)
- Return (x ^ 3 - 6 * x ^ 2 + 19.8)
- End Function
- Sub vivodlist(ByVal x As Double, ByVal l As ListBox)
- l.Items.Add(Format(x, "00.0000"))
- End Sub
- Sub vivod(ByVal x As Double, ByVal t As TextBox)
- t.Text = CStr(x)
- End Sub
- Sub tes(ByVal a As Double, ByVal b As Double, ByVal h As Double, ByRef pro As Double)
- Dim x, y, n As Double
- n = Fix((b - a) / h) + 1
- x = a
- pro = 1
- For i = 1 To n
- y = sa(x)
- If (y > 1.2) Then
- pro = pro * y
- End If
- vivodlist(x, ListBox1)
- vivodlist(y, ListBox2)
- x = x + h
- Next
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim a, b, h, pro As Double
- a = mvvod(TextBox4)
- b = mvvod(TextBox5)
- h = mvvod(TextBox6)
- tes(a, b, h, pro)
- vivod(pro, TextBox7)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement