VERSION 5.00 Begin VB.Form Int_c_p Caption = "Решение методом прямоугольников" ClientHeight = 6240 ClientLeft = 60 ClientTop = 375 ClientWidth = 7995 LinkTopic = "Form1" ScaleHeight = 6240 ScaleWidth = 7995 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command1 Caption = "Вычислить" Height = 495 Left = 4800 TabIndex = 24 Top = 5520 Width = 1455 End Begin VB.CommandButton Save Caption = "Сохранить как" Height = 495 Left = 3120 TabIndex = 23 Top = 5520 Width = 1455 End Begin VB.Frame Frame5 Caption = "Укажите путь:" Height = 735 Left = 240 TabIndex = 21 Top = 5400 Width = 2655 Begin VB.TextBox Text4 Height = 375 Left = 120 TabIndex = 22 Text = "C:\!p.txt" Top = 240 Width = 2415 End End Begin VB.CommandButton toMain Caption = "На главную" Height = 495 Left = 6480 TabIndex = 14 Top = 5520 Width = 1335 End Begin VB.Frame Frame1 Caption = "Численное решение методом прямоугольников" Height = 5175 Left = 120 TabIndex = 0 Top = 120 Width = 7695 Begin VB.Frame Frame4 Caption = "Погрешность" Height = 855 Left = 4920 TabIndex = 19 Top = 4080 Width = 2295 Begin VB.PictureBox Picture5 BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 120 ScaleHeight = 435 ScaleWidth = 1995 TabIndex = 20 Top = 240 Width = 2055 End End Begin VB.Frame Frame3 Caption = "По формуле прямоугольников" Height = 855 Left = 2520 TabIndex = 17 Top = 4080 Width = 2295 Begin VB.PictureBox Picture4 BeginProperty Font Name = "MS Sans Serif" Size = 13.5 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 120 ScaleHeight = 435 ScaleWidth = 1995 TabIndex = 18 Top = 240 Width = 2055 End End Begin VB.Frame Frame2 Caption = "Точное значение" Height = 855 Left = 120 TabIndex = 15 Top = 4080 Width = 2295 Begin VB.PictureBox Picture3 Height = 495 Left = 120 Picture = "Int_c_p.frx":0000 ScaleHeight = 435 ScaleWidth = 1995 TabIndex = 16 Top = 240 Width = 2055 End End Begin VB.TextBox Text3 BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 6360 TabIndex = 13 Text = "600" Top = 3360 Width = 855 End Begin VB.TextBox Text2 BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 3720 TabIndex = 10 Text = "6" Top = 3360 Width = 495 End Begin VB.TextBox Text1 BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 2880 TabIndex = 8 Text = "1" Top = 3360 Width = 495 End Begin VB.PictureBox Picture2 Height = 1695 Left = 120 Picture = "Int_c_p.frx":00C6 ScaleHeight = 1635 ScaleWidth = 6315 TabIndex = 4 Top = 1200 Width = 6375 End Begin VB.PictureBox Picture1 Height = 855 Left = 3480 Picture = "Int_c_p.frx":11BA ScaleHeight = 795 ScaleWidth = 795 TabIndex = 2 Top = 240 Width = 855 End Begin VB.Label Label8 Caption = "Задать количество разбиений (10-1000) : " Height = 255 Left = 4200 TabIndex = 12 Top = 3120 Width = 3135 End Begin VB.Label Label7 Caption = "]" BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 615 Left = 4200 TabIndex = 11 Top = 3360 Width = 135 End Begin VB.Label Label6 Caption = ";" BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 375 Left = 3480 TabIndex = 9 Top = 3360 Width = 135 End Begin VB.Label Label5 Caption = "[" BeginProperty Font Name = "MS Sans Serif" Size = 18 Charset = 204 Weight = 400 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 495 Left = 2760 TabIndex = 7 Top = 3360 Width = 255 End Begin VB.Label Label4 Caption = "Задать область интегрирования" Height = 255 Left = 120 TabIndex = 6 Top = 3360 Width = 2535 End Begin VB.Label Label3 Caption = "Вычислить тот же интеграл в Visual Baisic:" Height = 255 Left = 120 TabIndex = 5 Top = 3120 Width = 3375 End Begin VB.Label Label2 Caption = "считается:" Height = 375 Left = 4440 TabIndex = 3 Top = 360 Width = 855 End Begin VB.Label Label1 Caption = "По формуле Ньютона-Лейбница интеграл" Height = 375 Left = 120 TabIndex = 1 Top = 360 Width = 3375 End End End Attribute VB_Name = "Int_c_p" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim y(1000), Pogr_p, i_p As Double Private Sub Command1_Click() Picture4.Cls Picture5.Cls s = 0 a = Text1 B = Text2 k = Text3 H = (B - a) / k For N = 0 To k Step H y(N) = (Log(a + H * N) / (a + H * N)) ^ 3 Next For n1 = 0 To k Step 1 s = s + y(n1) Next i_p = s * H Pogr_p = Abs(s * H - 0.1804790225) Picture4.Print Format(i_p, "0.0000000000") Picture5.Print Format(Pogr_p, "0.0000000000") End Sub Private Sub Save_Click() On Error GoTo 2 sav = Text4.Text Open sav For Output As #1 Write #1, " Используемый метод: Метод Прямоугольников " Write #1, " Результат вычисления интешрала f(x)=(lnx/x)^3: " Write #1, " Истинное значение интеграла f(x) = " Write #1, "0,1804790225 " Write #1, " Вычисленное значение ="; Format(i_p, "0.0000000000") Write #1, " Погрешность = "; Format(Pogr_p, "0.0000000000") Write #1, " Число разбиений = "; Format(Text3, "0") Close #1 GoTo 3 2: MsgBox "Неправильно указан носитель или он отсутствует!" 'Ошибка! 3: MsgBox "Сохранено!" End Sub Private Sub toMain_Click() Main.Show Int_c_p.Hide End Sub