Advertisement
Guest User

Untitled

a guest
Nov 10th, 2018
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Imports System.Math
  2. Public Class Form1
  3.  
  4.     Function mvvod(ByVal t As TextBox)
  5.         Return Val(t.Text)
  6.     End Function
  7.  
  8.     Sub mvivod(ByVal x As Double, ByVal t As TextBox)
  9.         t.Text = CStr(x)
  10.     End Sub
  11.  
  12.     Sub mvivodint(ByVal x As Integer, ByVal t As TextBox)
  13.         t.Text = CStr(x)
  14.     End Sub
  15.  
  16.     Sub novojenova(ByVal x As Double, ByVal z As Double, ByRef y As Double, ByRef n As Integer)
  17.  
  18.         If (x < 0 And z < 0) Then
  19.             y = x
  20.             If (y > z) Then
  21.                 y = z
  22.             End If
  23.             n = 1
  24.         ElseIf (z > 0 And x > 0) Then
  25.             y = x
  26.             If (y < (x + z) ^ (1 / 3)) Then
  27.                 y = (x + z) ^ (1 / 3)
  28.             End If
  29.             If (y < Cos(x * z)) Then
  30.                 y = Cos(x * z)
  31.             End If
  32.             n = 2
  33.         Else
  34.             y = x + z
  35.             n = 3
  36.         End If
  37.     End Sub
  38.  
  39.  
  40.  
  41.  
  42.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  43.         Dim x, z, y As Double, n As Double
  44.  
  45.         x = mvvod(TextBox1)
  46.         z = mvvod(TextBox2)
  47.  
  48.         novojenova(x, z, y, n)
  49.         mvivod(y, TextBox3)
  50.         mvivodint(n, TextBox4)
  51.     End Sub
  52. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement