_RayBoy_

copy

Nov 2nd, 2021 (edited)
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.05 KB | None | 0 0
  1.     def Info(self):
  2.         box = QMessageBox()
  3.         box.setWindowTitle('Об авторе')
  4.         box.setText('Программа была написана студентом \nФГиИБ ИСиТ I-1Б ???')
  5.         box.setIcon(QMessageBox.Information)
  6.         box.setStandardButtons(QMessageBox.Ok)
  7.         box.exec_()
  8.  
  9.     def Integral(self):
  10.         self.label_5.setText('   ')
  11.         s1, s2, iter = 1, 0, 0
  12.         n, i = 4, 0
  13.         a = int(self.textEdit.toPlainText())
  14.         b = int(self.textEdit_2.toPlainText())
  15.         eps = float(self.textEdit_3.toPlainText())
  16.         while abs(s2 - s1) >= eps:
  17.             s1, s2 = s2, 0
  18.             n *= 2
  19.             h = (b - a) / n
  20.             iter += 1
  21.             i = 0
  22.             while i < n:
  23.                 x = a + h * (i + 0.5)
  24.                 k = %Формула%
  25.                 s2 += k * h
  26.                 i += 1
  27.         Otvet = '\nЗначение интеграла: ' + str("%.3f" % s2) + '\nКол-во интераций: ' + str(iter)
  28.         self.label_5.setText(Otvet)
Add Comment
Please, Sign In to add comment