Facebook
From Gray Sloth, 2 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 31
  1. Public Class Form1
  2.     Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  3.         Dim a, b, c As Single, oper As String
  4.         a = Rnd() * 300 : b = Rnd() * 200
  5.         TextBox1.Text = Format(a, "###.#")
  6.         TextBox2.Text = Format(b, "###.#")
  7.         oper = InputBox("Введите название операции", "Операция")
  8.  
  9.         If oper = "сложение" Then
  10.             c = a + b
  11.             TextBox4.Text = Format("+")
  12.  
  13.         End If
  14.         If oper = "вычитание" Then
  15.             c = a - b
  16.             TextBox4.Text = Format("-")
  17.  
  18.         End If
  19.         If oper = "умноженние" Then
  20.             c = a * b
  21.             TextBox4.Text = Format("*")
  22.         End If
  23.         If oper = "деление" And b <> 0 Then
  24.             c = a / b
  25.             TextBox4.Text = Format(c, "######.####")
  26.  
  27.         End If
  28.         TextBox4.Text = Format(c, "######.####")
  29.     End Sub
  30.  
  31.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  32.         Me.Close()
  33.     End Sub
  34. End Class
  35.