You are on page 1of 6

Colegio nacional de educación profesional técnica del estado de chihuahua

Programación con sistemas gestores de base de datos

PSP; Sergio González Pérez

Diana Raquel Torres Castillo

Practica#22

“Manejo de estructuras de repetición en ordenamiento”

12 noviembre 2010

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

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


PSGBD
Instructor: Ing. Sergio González Pérez Grupo: 5101
Alumno: Diana Raquel Torres Castillo Fecha de aplicación : 12/Noviembre/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 
LeRaquel

Firma del Alumnos Firma del Instructor

Public Class Form1


Limpiar
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button3.Click
ListBox1.Items.Clear()
End Sub
Generar
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button1.Click
ListBox1.Items.Add(9)
ListBox1.Items.Add(5)
ListBox1.Items.Add(8)
ListBox1.Items.Add(2)
ListBox1.Items.Add(7)
End Sub
Burbuja
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

Public Class Form1


Dim dt As New DataTable
Dim cn As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:\Torres\Fechas.mdb")
Public fila As Integer = 0

Fecha seleccionada
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
Label1.Text = Str(ListBox1.SelectedItem)
Select Case Int(ListBox2.SelectedItem)
Case 1
Label1.Text = Label1.Text + " de enero de "
Case 2
Label1.Text = Label1.Text + " de febrero de "
Case 3
Label1.Text = Label1.Text + " de marzo de "
Case 4
Label1.Text = Label1.Text + " de abril de "
Case 5
Label1.Text = Label1.Text + " de mayo de "
Case 6
Label1.Text = Label1.Text + " de junio de "
Case 7
Label1.Text = Label1.Text + " de julio de "
Case 8
Label1.Text = Label1.Text + " de agosto de "
Case 9
Label1.Text = Label1.Text + " de septiembre de "
Case 10
Label1.Text = Label1.Text + " de octubre de "
Case 11
Label1.Text = Label1.Text + " de noviembre de "
Case 12
Label1.Text = Label1.Text + " de diciembre de "
End Select
Label1.Text = Label1.Text + Str(ListBox3.SelectedItem)
End Sub
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
Consultar
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

Ordenar
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles
Button3.Click
Dim a(6) 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)
a(5) = ListBox1.Items(5)
For x = 0 To 5
For y = 0 To 4
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 5
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)
a(4) = ListBox2.Items(4)
a(5) = ListBox2.Items(5)
For x = 0 To 5
For y = 0 To 4
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 5
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)
a(4) = ListBox3.Items(4)
a(5) = ListBox3.Items(5)
For x = 0 To 5
For y = 0 To 4
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 5
ListBox3.Items.Add(a(x))
Next x
End Sub
End Class

You might also like