Option Explicit On
Imports System.Math
Public Class Form1
'Функция ввода в TextBox
Function vvod(ByVal T As TextBox) As Double
Return CSng(Val(T.Text))
End Function
'Процедура вывода результата в TextBox
Sub vivod(ByVal h As Double, ByVal T As TextBox)
T.Text = CStr(h)
End Sub
' Процедура- Function f_u1 вычисляет значение уравнения
Function f_1(ByVal x As Single, ByVal y As Single, ByVal z As Single, ByVal a As Single, ByVal h As Single) As Single
Return CSng(x ^ 3 + Abs(a) * Sin(y))
End Function
' Процедура- Function f_u2 вычисляет значение уравнения
Function f_2(ByVal x As Single, ByVal y As Single, ByVal z As Single, ByVal a As Single, ByVal h As Single) As Single
Return CSng(Max(x, y, z))
End Function
' Процедура- Function f_u3 вычисляет значение уравнения
Function f_3(ByVal x As Single, ByVal y As Single, ByVal z As Single, ByVal a As Single, ByVal h As Single) As Single
Return CSng(Min(x ^ 1 / 3, a * y, Sqrt(Abs(z))))
End Function
'Вычисление значения разветляющейся задачи
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim x As Double
Dim y As Double
Dim z As Double
Dim h As Double
Dim a As Single
x = vvod(TextBox1)
y = vvod(TextBox2)
z = vvod(TextBox3)
a = vvod(TextBox4)
If (Abs(x)) ^ y < z Then
f_1(x, y, z, a, h)
vivod(h, TextBox5)
MsgBox("Расчет прошел по 1 условию (Abs(x)) ^ y < z ")
ElseIf z <= (Abs(x)) ^ y <= z + 10 Then
f_2(x, y, z, a, h)
vivod(h, TextBox5)
MsgBox("Расчет прошел по 2 условию z <= (Abs(x)) ^ y <= z + 10")
ElseIf (z <> (Abs(x)) ^ y) Then
f_3(x, y, a, h)
vivod(h, TextBox5)
MsgBox("Расчет прошел по 3 условию в противном случе")
End If
End Sub
Private Sub button2_click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
End Sub
End Class