Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Math
- Public Class Form1
- Function mvvod(ByVal T As TextBox) As Double
- Return Val(T.Text)
- End Function
- Sub vivodList(ByVal x As Double, ByVal LB As ListBox)
- LB.Items.Add(Format(x, "00.0000"))
- End Sub
- Sub ser(ByVal a As Double, ByVal b As Double, ByVal h As Double)
- Dim z, n, x As Double
- n = CInt(Fix(b - a) / h) + 1
- x = a
- For i = 1 To n
- If x >= 0 And x <= 5 Then
- z = 5 * Exp(x)
- ElseIf x > 5 Then
- z = 2 * Sin(x)
- ElseIf x < 0 Then
- z = Abs(x)
- End If
- vivodList(x, ListBox1)
- vivodList(z, ListBox2)
- x = x + h
- Next
- End Sub
- Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
- Dim a, b, h As Double
- a = mvvod(TextBox4)
- b = mvvod(TextBox5)
- h = mvvod(TextBox6)
- ser(a, b, h)
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement