VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 6135 ClientLeft = 60 ClientTop = 435 ClientWidth = 7245 LinkTopic = "Form1" ScaleHeight = 6135 ScaleWidth = 7245 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command4 Caption = "GRAPH2" Height = 644 Left = 1764 TabIndex = 5 Top = 5040 Width = 1148 End Begin VB.CommandButton Command3 Caption = "GRAPH1" Height = 644 Left = 252 TabIndex = 4 Top = 5040 Width = 1274 End Begin VB.PictureBox Picture2 BackColor = &H80000014& Height = 4424 Left = 252 ScaleHeight = 4365 ScaleWidth = 3480 TabIndex = 3 Top = 378 Width = 3542 End Begin VB.CommandButton Command2 Caption = "EXIT" Height = 644 Left = 5418 TabIndex = 2 Top = 5166 Width = 1778 End Begin VB.CommandButton Command1 Caption = "RUN" Height = 644 Left = 5544 TabIndex = 1 Top = 252 Width = 1652 End Begin VB.PictureBox Picture1 Height = 3794 Left = 3906 ScaleHeight = 3735 ScaleWidth = 3225 TabIndex = 0 Top = 1008 Width = 3290 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Dim i As Integer, a As Integer, n As Integer, s As Single, h As Single, st As Single, etal As Single, pi As Single Dim mas(1 To 2, 1 To 20) As Single Function F(x) As Double F = Exp(x) * Cos(x) * Cos(x) End Function Function FP(x) As Double FP = Exp(x) * (0.5 + 0.2 * Sin(2 * x) + 0.1 * Cos(2 * x)) End Function Private Sub Command1_Click() Picture1.Cls n = 0 pi = 3.141592653589 etal = FP(pi) - FP(0) For i = 1 To 20 n = n + 10 h = pi / n s = 0 st = 0 j = 1 Do s = s + F(h / 2 + h * (j - 1)) st = st + F(h * j - h / 2) j = j + 1 Loop Until Not (j <= n) mas(1, i) = s * h - etal mas(2, i) = st * h - etal Picture1.Print "for n="; n; "int Pr="; Format(s * h - etal, "0.000000"); " int Pr="; Format(st * h - etal, "0.000000") Next i End Sub Private Sub Command2_Click() End End Sub Private Sub Command3_Click() Picture2.Cls Picture2.Line (100, 3000)-(3400, 3000), RGB(0, 0, 0) Picture2.Line (3400, 3000)-(3300, 3040), RGB(0, 0, 0) Picture2.Line (3400, 3000)-(3300, 2960), RGB(0, 0, 0) Picture2.Line (100, 3000)-(100, 500), RGB(0, 0, 0) Picture2.Line (100, 500)-(140, 600), RGB(0, 0, 0) Picture2.Line (100, 500)-(60, 600), RGB(0, 0, 0) h = 160 mast = 2000 / mas(1, 1) For i = 1 To 19 Picture2.Line (100 + 160 * i, Abs(3000 - mast * mas(1, i)))-(260 + 160 * i, Abs(3000 - mast * mas(1, i + 1))), RGB(255, 0, 255) 'Picture2.Line (100 + 160 * i, Abs(3000 - mast * mas(2, i)))-(260 + 160 * i, Abs(3000 - mast * mas(2, i + 1))), RGB(0, 255, 255) Next i End Sub Private Sub Command4_Click() Picture2.Cls Picture2.Line (100, 3000)-(3400, 3000), RGB(0, 0, 0) Picture2.Line (3400, 3000)-(3300, 3040), RGB(0, 0, 0) Picture2.Line (3400, 3000)-(3300, 2960), RGB(0, 0, 0) Picture2.Line (100, 3000)-(100, 500), RGB(0, 0, 0) Picture2.Line (100, 500)-(140, 600), RGB(0, 0, 0) Picture2.Line (100, 500)-(60, 600), RGB(0, 0, 0) h = 160 mast = 2000 / mas(1, 1) For i = 1 To 19 'Picture2.Line (100 + 160 * i, Abs(3000 - mast * mas(1, i)))-(260 + 160 * i, Abs(3000 - mast * mas(1, i + 1))), RGB(255, 0, 255) Picture2.Line (100 + 160 * i, Abs(3000 - mast * mas(2, i)))-(260 + 160 * i, Abs(3000 - mast * mas(2, i + 1))), RGB(0, 255, 255) Next i End Sub Private Sub Picture2_Click() End Sub