Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Otchet_4_3.doc
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
1 Мб
Скачать
☆

Cхема алгоритма процедуры подпрограммы proc1()

Cхема алгоритма процедуры proc2()

Схема алгоритма программы

Программный код первого проекта.

Option Explicit On

Imports System.Math

Public Class Form1

Function funtik(ByVal x As Double, ByVal y As Double) As Double

Dim a As Double

a = (10 * (Log(y ^ 2) - (Abs(x - y)) ^ (1 / 4)) / (1 - (Cos(y)) ^ 3))

Return a

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'Объявление элементов'

Dim x, y, a As Double

Dim i, j As Integer

Dim p As Single

Dim s1, s2 As String

'Ввод данных'

x = TextBox1.Text

y = TextBox2.Text

'Вычисление'

a = funtik(x, y)

i = a

j = Fix(a)

p = a

s1 = a

s2 = p

'Вывод'

TextBox3.Text = a

TextBox4.Text = i

TextBox5.Text = j

TextBox6.Text = Int(a)

TextBox7.Text = p

TextBox8.Text = a + p

TextBox9.Text = s1 + s2

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

'Очистка'

TextBox1.Clear()

TextBox2.Clear()

TextBox3.Clear()

TextBox4.Clear()

TextBox5.Clear()

TextBox6.Clear()

TextBox7.Clear()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

'Выход'

Application.Exit()

End Sub

End Class

Программный код второго проекта.

Option Strict On

Option Explicit On

Imports System.Math

Public Class Form1

Sub proc1(ByVal x As Double, ByVal y As Double, ByRef a As Double)

a = (10 * (Log(y ^ 2) - (Abs(x - y)) ^ (1 / 4)) / (1 - (Cos(y)) ^ 3))

End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

'Объявление элементов'

Dim x, y, a As Double

Dim i, j As Integer

Dim p As Single

Dim s1, s2 As String

'Ввод данных'

x = CDbl(Val(TextBox1.Text))

y = CDbl(Val(TextBox2.Text))

'Вычисление'

a = funtik(x, y)

i = CInt(a)

j = CInt(Fix(a))

p = CSng(a)

s1 = CStr(a)

s2 = CStr(p)

'Вывод'

TextBox3.Text = CStr(a)

TextBox4.Text = CStr(i)

TextBox5.Text = CStr(j)

TextBox6.Text = CStr(Int(a))

TextBox7.Text = CStr(p)

TextBox8.Text = CStr(a + p)

TextBox9.Text = s1 + s2

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click

'Очистка'

TextBox1.Clear()

TextBox2.Clear()

TextBox3.Clear()

TextBox4.Clear()

TextBox5.Clear()

TextBox6.Clear()

TextBox7.Clear()

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

'Выход'

Application.Exit()

End Sub

End Class

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