Ejercicios De Progarmacion De Bases De Datos

Páginas: 6 (1474 palabras) Publicado: 23 de octubre de 2012
Ejercicio 3

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim num As Integer
num = InputBox("Entrar un numero", "Numero par", "1")
Do While num Mod 2 <> 0
num = InputBox("Entrar un numero", "Numero par", "1")
Loop
End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e AsSystem.EventArgs) Handles Button2.Click
Dim fact As Long
Dim num, i As Integer
fact = 1
num = NumericUpDown1.Value
For i = 1 To num Step 1
fact = fact * i
Next i

TextBox1.Text = fact
End Sub

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

End Sub

Private Sub TextBox3_TextChanged(ByVal sender As System.Object, ByVal e AsSystem.EventArgs)

End Sub

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim residuo As Double
Dim p, n As Integer
n = TextBox2.Text
For i As Integer = 1 To n
residuo = n Mod i
If residuo = 0 Then
p = p + 1
End If
Next i
If p <= 2 Then
MessageBox.Show("El número introducido es primo")
Else
MessageBox.Show("El númerointroducido no es primo")
End If
End Sub

Private Sub Label4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label4.Click

End Sub

Private Sub Label5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label5.Click

End Sub

Private Sub GroupBox4_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox4.Enter

End SubPrivate Sub ListBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged

End Sub

Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Dim n1, n2, i, x, p As Integer
Dim res As Double
n1 = TextBox3.Text
n2 = TextBox4.Text
For i = n1 To n2
p = 0
For x = 1 To ires = i Mod x
If res = 0 Then
p = p + 1
End If
Next
If p <= 2 Then
ListBox1.Items.Add(i)
End If
Next
End Sub

Private Sub TextBox4_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox4.TextChanged

End Sub

Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
ListBox1.Items.Clear()
End SubPrivate Sub GroupBox5_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox5.Enter

End Sub

Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
Dim n, x As Integer
n = NumericUpDown2.Value
For x = 1 To 10 Step 1
ListBox2.Items.Add(n & "x" & x & "=" & n * x)
Next
End Sub

Private SubButton7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
ListBox2.Items.Clear()
End Sub

Private Sub GroupBox6_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs)

End Sub

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
Close()
End Sub
End Class

Ejercicio 2
Public Class Ejercicio2

PrivateSub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("mayor")
ComboBox1.Items.Add("menor")
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim N As Integer
N = TextBox1.Text
If N Mod 2 = 0 Then
MessageBox.Show("EL NUMERO ES PAR")
Else
MessageBox.Show("ELNUMERO ES IMPAR")
End If
End Sub

Private Sub GroupBox2_Enter(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles GroupBox2.Enter

End Sub

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim edad As Integer
edad = NumericUpDown1.Value
If edad > 17 Then
GroupBox2.Visible = True
Else
GroupBox2.Visible =...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Ejercicio Modelamiento de base de datos
  • Ejercicios base de datos
  • Ejercicio base de datos
  • Ejercicios Bases de Datos
  • Ejercicio de bases de datos en sql
  • EJERCICIOS BASE DE DATOS
  • Ejercicios Teoricos Base De Datos
  • Ejercicio Bases De Datos

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS