Программирование на Visual Basic For Application - Практическая работа

бесплатно 0
4.5 66
Написание программы, которая ищет корни квадратного уравнения с заданными коэффициентами. Программирование разветвляющихся процессов и рекуррентных вычислений. Определение количества членов ряда. Решение задач в духе идеологии суммирования рядов.

Скачать работу Скачать уникальную работу

Чтобы скачать работу, Вы должны пройти проверку:


Аннотация к работе
МИНИСТЕРСТВО ОБРАЗОВАНИЯ И НАУКИ РОССИЙСКОЙ ФЕДЕРАЦИИ ФЕДЕРАЛЬНОЕ ГОСУДАРСТВЕННОЕ БЮДЖЕТНОЕ ОБРАЗОВАТЕЛЬНОЕ УЧРЕЖДЕНИЕ НАЦИОНАЛЬНЫЙ МИНЕРАЛЬНО-СЫРЬЕВОЙ УНИВЕРСИТЕТ «ГОРНЫЙ»Дизайн формы: Консоль Public Sub pr1() Dim a As Single, b As Single, c As Single Dim x1 As Single, x2 As Single, d As Single a = INPUTBOX("a") b = INPUTBOX("b") c = INPUTBOX("c") d = (b ^ 2) - (4 * a * c) x1 = (-b Sqr(d)) / (2 * a) x2 = (-b - Sqr(d)) / (2 * a) MSGBOX ("d= " Str(d) "x1= " Str(x1) "x2= " Str(x2)) ENDSUB Окно Private Sub COMMANDBUTTON1_Click() Dim a As Single, b As Single, c As Single Dim x1 As Single, x2 As Single, d As Single a = Val(TEXTBOX1.Text) b = Val(TEXTBOX2.Text) c = Val(TEXTBOX3.Text) d = (b ^ 2) - (4 * a * c) x1 = (-b Sqr(d)) / (2 * a) x2 = (-b - Sqr(d)) / (2 * a) TEXTBOX6.Text = "d= " Str(d) TEXTBOX4.Text = "x1= " Str(x1) TEXTBOX5.Text = "x2= " Str(x2) ENDSUB DO Private Sub COMMANDBUTTON3_Click() Dim a As Integer, b As Integer Dim i As Integer, s As Integer a = Val(TEXTBOX1.Text) b = Val(TEXTBOX2.Text) s = 0 i = a Do s = s i ^ 2 i = i 1 Loop Until i> b TEXTBOX5.Text = "s= " Str(s) End Sub WHILE Private Sub COMMANDBUTTON2_Click() Dim a As Integer, b As Integer Dim i As Integer, s As Integer a = Val(TEXTBOX1.Text) b = Val(TEXTBOX2.Text) s = 0 i = a While i<= b s = s i ^ 2 i = i 1 Wend TEXTBOX4.Text = "s= " Str(s) End Sub Private Sub COMMANDBUTTON1_Click() Dim n As Integer, i As Integer Dim s As Single, a As Single n = Val(TEXTBOX1.Text) Cells(1, 1) = "N=" Cells(2, 1) = "A=" Cells(3, 1) = "S=" a = 1 / 2 s = 0 For i = 1 To n Cells(1, i 1) = Str(i) s = s a Cells(3, i 1) = Str(s) Cells(2, i 1) = Str(a) a = a * i / (2 * i 2) Next i TEXTBOX2.Text = Str(s) Charts.Add With ACTIVECHART .CHARTTYPE = XLLINE .SETSOURCEDATA Source:=Sheets("Лист1").Range(Sheets("Лист1").Cells(2, 2), Sheets("Лист1").Cells(3, n 1)), PLOTBY:=XLROWS .SERIESCOLLECTION(1).XVALUES = Sheets("Лист1").Range(Sheets("Лист1").Cells(1, 2), Sheets("Лист1").Cells(1, n 1)) .SERIESCOLLECTION(2).XVALUES = Sheets("Лист1").Range(Sheets("Лист1").Cells(1, 2), Sheets("Лист1").Cells(1, n 1)) .Location Where:=XLLOCATIONASOBJECT, Name:="Лист1" End With End Sub Private Sub COMMANDBUTTON2_Click() Dim i As Integer Dim s As Single, a As Single Dim st As Single, e As Single e = Val(TEXTBOX3.Text) a = 1 / 2 s = 0 i = 1 st = Log(2) While Abs(s - st) >= e s = s a a = a * i / (2 * i 2) i = i 1 Wend TEXTBOX4.Text = Str(i - 1) TEXTBOX5.Text = Str(s) ENDSUB Private Sub COMMANDBUTTON3_Click() Dim i As Integer Dim s As Single, a As Single Dim e As Single e = Val(TEXTBOX6.Text) a = 1 / 2 s = 0 i = 1 While Abs(a) >= e s = s a a = a * i / (2 * i 2) i = i 1 Wend TEXTBOX7.Text = Str(i - 1) TEXTBOX8.Text = Str(s) ENDSUB Private Sub COMMANDBUTTON1_Click() Dim n As Integer, i As Integer Dim s As Single, a As Single, x As Single n = Val(TEXTBOX1.Text) x = Val(TEXTBOX2.Text) Cells(1, 1) = "N=" Cells(2, 1) = "A=" Cells(3, 1) = "S=" a = 1 s = 0 For i = 0 To n Cells(1, i 2) = Str(i) s = s a Cells(3, i 2) = Str(s) a = a * x / (i 1) Cells(2, i 2) = Str(a) Next i TEXTBOX3.Text = Str(s) Charts.Add With ACTIVECHART .CHARTTYPE = XLLINE .SETSOURCEDATA Source:=Sheets("Лист1").Range(Sheets("Лист1").Cells(2, 2), Sheets("Лист1").Cells(3, n 1)), PLOTBY:=XLROWS .SERIESCOLLECTION(1).XVALUES = Sheets("Лист1").Range(Sheets("Лист1").Cells(1, 2), Sheets("Лист1").Cells(1, n 1)) .SERIESCOLLECTION(2).XVALUES = Sheets("Лист1").Range(Sheets("Лист1").Cells(1, 2), Sheets("Лист1").Cells(1, n 1)) Location Where:=XLLOCATIONASOBJECT, Name:="Лист1" End With End Sub Private Sub COMMANDBUTTON2_Click() Dim i As Integer Dim s As Single, a As Single Dim st As Single, e As Single e = Val(TEXTBOX5.Text) x = Val(TEXTBOX4.Text) a = 1 s = 0 i = 0 st = exp(1) While Abs(s - st) >= e s = s a a = a * x / (i 1) i = i 1 Wend TEXTBOX6.Text = Str(i - 1) TEXTBOX10.Text = Str(s) End Sub Private Sub COMMANDBUTTON3_Click() Dim i As Integer, e As Single Dim s As Single, a As Single, x As Single e = Val(TEXTBOX8.Text) x = Val(TEXTBOX7.Text) a = 1 s = 0 i = 0 While Abs(a) >= e s = s a a = a * x / (i 1) i = i 1 Wend TEXTBOX9.Text = Str(i - 1) TEXTBOX11.Text = Str(s) ENDSUB Private Sub COMMANDBUTTON1_Click() Dim n As Integer, i As Integer Dim s As Single, a As Single, x As Single n = Val(TEXTBOX1.Text) x = Val(TEXTBOX2.Text) Cells(1, 1) = "N=" Cells(2, 1) = "A=" Cells(3, 1) = "S=" a = x - 1 s = 0 For i = 1 To n Cells(1, i 1) = Str(i) s = s a Cells(2, i 1) = Str(a) Cells(3, i 1) = Str(s) a =-a * (x - 1) * i / (i 1) Next i TEXTBOX3.Text = Str(s) Charts.Add

Вы можете ЗАГРУЗИТЬ и ПОВЫСИТЬ уникальность
своей работы


Новые загруженные работы

Дисциплины научных работ





Хотите, перезвоним вам?