Advertisement
idsystems

VBNet_AC07

Sep 24th, 2012
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 1.35 KB | None | 0 0
  1. Public Class Form1
  2. // Actividad 07 - Funciones matematicas
  3.  
  4.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  5.         Dim azar As Integer
  6.         Randomize()
  7.         azar = Int(10 * Rnd()) + 1
  8.         TextBox1.Text = azar
  9.     End Sub
  10.  
  11.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
  12.         Dim azar As Integer
  13.         Dim rangomenor As Integer
  14.         Dim rangomayor As Integer
  15.         Randomize()
  16.         rangomayor = CInt(TextBox2.Text)
  17.         rangomenor = CInt(TextBox3.Text)
  18.         azar = Int((rangomayor - rangomenor + 1) * Rnd()) + rangomenor
  19.         TextBox4.Text = azar
  20.  
  21.     End Sub
  22.  
  23.     Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
  24.         Dim numero As Integer
  25.         Dim raiz As Integer
  26.         raiz = CInt(TextBox5.Text)
  27.         numero = CInt(TextBox6.Text)
  28.         TextBox7.Text = numero ^ (1 / raiz)
  29.     End Sub
  30.  
  31.     Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
  32.         Dim numero As Integer
  33.         Dim decimales As Integer
  34.         numero = TextBox8.Text
  35.         decimales = CInt(TextBox9.Text)
  36.         TextBox10.Text = Math.Round(numero, decimales)
  37.     End Sub
  38. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement