VERSION 5.00 Begin VB.Form Form1 BackColor = &H80000003& BorderStyle = 0 'None Caption = "Табулирование функций" ClientHeight = 1335 ClientLeft = 0 ClientTop = 0 ClientWidth = 4695 Icon = "Form1.frx":0000 LinkTopic = "Form1" ScaleHeight = 1335 ScaleWidth = 4695 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton Command5 Caption = "Вывод координат точек функции" Height = 255 Left = 120 TabIndex = 5 Top = 960 Width = 4455 End Begin VB.CommandButton Command4 Caption = "Ввод данных" Height = 255 Left = 120 TabIndex = 4 Top = 600 Width = 4455 End Begin VB.CommandButton Command3 Enabled = 0 'False Height = 855 Left = 0 TabIndex = 3 Top = 480 Width = 4695 End Begin VB.CommandButton Command1 Caption = "X" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = 4320 TabIndex = 2 Top = 120 Width = 255 End Begin VB.CommandButton Command2 Caption = "_" BeginProperty Font Name = "MS Sans Serif" Size = 8.25 Charset = 204 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 255 Left = 3960 TabIndex = 1 Top = 120 Width = 255 End Begin VB.Image Image1 Height = 255 Left = 120 Picture = "Form1.frx":0442 Stretch = -1 'True Top = 120 Width = 255 End Begin VB.Label Label1 BackColor = &H80000002& BorderStyle = 1 'Fixed Single Caption = " Табулирование функций" BeginProperty Font Name = "MS Sans Serif" Size = 12 Charset = 204 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty ForeColor = &H80000009& Height = 375 Left = 60 TabIndex = 0 Top = 60 Width = 4575 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim Funktion As String Dim tochn, n, X, Y, S, X1, X2, sd As Double Function Factorial(c) As Integer Factorial = 1 For t = 1 To c Factorial = Factorial * t Next End Function Private Sub Command1_Click() End End Sub Private Sub Command2_Click() Form1.WindowState = 1 End Sub Private Sub Command4_Click() Funktion = "" spos = MsgBox("Вычислить S=-(2x)^2/2+(2x)^4/24+...+(-1)^n*(2x)^2n/(2n)! - Да" & Chr(13) & Chr(10) & "или 2((cos(x))^2-1) --- Нет", vbYesNo, "Выбор функции") If spos = vbYes Then n = 0 X1 = Val(InputBox("Введите начальное значение Х", "Ввод начальных значений", "0.1")) X2 = Val(InputBox("Введите конечное значение Х", "Ввод начальных значений", "1")) h = Val(InputBox("Введите шаг", "Ввод начальных значений", ".1")) tochn = Val(InputBox("Введите точность вычисления функции", "Ввод начальных значений", Format(15 ^ (-4), "#.############"))) X = X1 - h For X = X1 To X2 Step h S = 0 n = 0 Do n = n + 1 S = ((-1) ^ n) * ((2 * X) ^ (2 * n)) / Factorial(2 * n) Y = Y + S Loop While Abs(sd) > tochn Funktion = Funktion & "(" & Format(X, "0.0########") & ";" & Format(Y, "0.############") & ")" & Chr(13) & Chr(10) Next Else X1 = Val(InputBox("Введите начальное значение Х", "Ввод начальных значений", "0.1")) X2 = Val(InputBox("Введите конечное значение Х", "Ввод начальных значений", "1")) h = Val(InputBox("Введите шаг", "Ввод начальных значений", ".1")) For X = X1 To X2 Step h Y = 2 * ((Cos(X)) ^ 2 - 1) Funktion = Funktion & "(" & Format(X, "0.0########") & ";" & Format(Y, "0.###") & ")" & Chr(13) & Chr(10) Next End If End Sub Private Sub Command5_Click() MsgBox "Полученные координаты" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & Funktion, , "Вывод функции" End Sub