Está en la página 1de 6

Programación en Sistemas Gestores de Bases

de Datos

Practica #22
Manejo de Estructuras de Repetición en ordenamiento

Sarahi Vázquez Wallmach

Gpo: 5101

Matricula: 080260221-9

Sergio González Pérez

Lista de Cotejo
Práctica # 22 Manejo de estructuras de repetición en
ordenamiento

Nombre de la Materia: Plantel: Conalep Juárez I


Programación Básica
Instructor: Ing. Sergio González Pérez Grupo: 5101

Alumno: Sarahi Vázquez Wallmach Fecha de aplicación 12/ Nov. / 2010

INSTRUCCIONES DE APLICACIÓN.
Verifique que se encuentren los componentes señalados abajo y marque con una √ el registro
de cumplimiento correspondiente.

REGISTRO DE

No Características a verificar CUMPLIMIENTO OBSERVACIONES


SI NO
1 Inicia el Sistema Gestor de Base de Datos *
2 Abre la Base de Datos que será utilizada *
3 Realiza los pasos de la practica *
4 Manipula correctamente el SGBD *
5 Almacena en su carpeta las actividades planteadas *
6 Realiza el reporte del resultado del programa. *
DESARROLLO

REGISTRO DE

No Actividades a desarrollar CUMPLIMIENTO OBSERVACIONES


SI NO
1 Inicializa Lenguaje de Programación *
2 Agrega Formulario *
3 Diseña los Controles del Formulario *
4 Realiza Código de Ordenamiento Numérico *

Sarahi V. W.

Firma del Alumnos Firma del Instructor

Burbuja

Public Class Form1


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click

ListBox1.Items.Add(15)
ListBox1.Items.Add(3)
ListBox1.Items.Add(7)
ListBox1.Items.Add(8)
ListBox1.Items.Add(17)

End Sub

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


Button2.Click
Dim a(5) As Integer
Dim x As Integer
Dim y As Integer
Dim temp As Integer

a(0) = ListBox1.Items(0)
a(1) = ListBox1.Items(1)
a(2) = ListBox1.Items(2)
a(3) = ListBox1.Items(3)
a(4) = ListBox1.Items(4)

For x = 0 To 4
For y = 0 To 3
If (a(y) <= a(y + 1)) Then
temp = a(y)
a(y) = a(y + 1)
a(y + 1) = temp

End If

Next y

Next x
ListBox1.Items.Clear()

For x = 0 To 4
ListBox1.items.Add(a(x))
Next x

End Sub
End Class
FechasBurbuja
Imports System.Data.OleDb
Public Class Form1
Dim dt As New DataTable
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Wallmach\Fecha.mdb")
Public fila As Integer = 0

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


Button2.Click
Label4.Text = Str(ListBox1.SelectedItem)
Select Case Int(ListBox2.SelectedItem)
Case 1
Label4.Text = Label4.Text + " de Enero de "

Case 2
Label4.Text = Label4.Text + " de Febrero de "

Case 3
Label4.Text = Label4.Text + " de Marzo de "

Case 4
Label4.Text = Label4.Text + " de Abril de "

Case 5
Label4.Text = Label4.Text + " de Mayo de "

Case 6
Label4.Text = Label4.Text + " de Junio de "

Case 7
Label4.Text = Label4.Text + " de Julio de "

Case 8
Label4.Text = Label4.Text + " de Agosto de "

Case 9
Label4.Text = Label4.Text + " de Septiembre de "

Case 10
Label4.Text = Label4.Text + " de Octubre de "

Case 11
Label4.Text = Label4.Text + " de Noviembre de "

Case 12
Label4.Text = Label4.Text + " de Diciembre de "

End Select
Label4.Text = Label4.Text + Str(ListBox3.SelectedItem)
End Sub
'METODO ACTUALIZA EL LISTBOX
Public Sub Actualiza()
ListBox1.Items.Add(Int(dt.Rows(fila)("D")))
ListBox2.Items.Add(Int(dt.Rows(fila)("M")))
ListBox3.Items.Add(Int(dt.Rows(fila)("A")))
End Sub

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


Button1.Click
cn.Open()
Dim mostrardatos As String = "Select * from Fechas"
Dim dataAdapter As New OleDb.OleDbDataAdapter(mostrardatos, cn)
dataAdapter.Fill(dt)
For fila = 0 To dt.Rows.Count - 1
Actualiza()
Next
dataAdapter.Dispose()
cn.Close()
End Sub

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


Button3.Click
Dim a(4) As Integer
Dim x As Integer
Dim y As Integer
Dim temp As Integer

a(0) = ListBox1.Items(0)
a(1) = ListBox1.Items(1)
a(2) = ListBox1.Items(2)
a(3) = ListBox1.Items(3)

For x = 0 To 3
For y = 0 To 2
If (a(y) <= a(y + 1)) Then
temp = a(y)
a(y) = a(y + 1)
a(y + 1) = temp

End If

Next y

Next x
ListBox1.Items.Clear()

For x = 0 To 3
ListBox1.Items.Add(a(x))
Next x
a(0) = ListBox2.Items(0)
a(1) = ListBox2.Items(1)
a(2) = ListBox2.Items(2)
a(3) = ListBox2.Items(3)

For x = 0 To 3
For y = 0 To 2
If (a(y) <= a(y + 1)) Then
temp = a(y)
a(y) = a(y + 1)
a(y + 1) = temp

End If

Next y

Next x
ListBox2.Items.Clear()

For x = 0 To 3
ListBox2.Items.Add(a(x))
Next x

a(0) = ListBox3.Items(0)
a(1) = ListBox3.Items(1)
a(2) = ListBox3.Items(2)
a(3) = ListBox3.Items(3)

For x = 0 To 3
For y = 0 To 2
If (a(y) <= a(y + 1)) Then
temp = a(y)
a(y) = a(y + 1)
a(y + 1) = temp

End If

Next y

Next x
ListBox3.Items.Clear()

For x = 0 To 3
ListBox3.Items.Add(a(x))
Next x
End Sub
End Class

También podría gustarte