ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

EN MODULO SE REALIZAN LAS SIGUIENTES DECLARACIONES: PROGRAMACION

alexro221082Ensayo9 de Febrero de 2018

1.930 Palabras (8 Páginas)182 Visitas

Página 1 de 8

EN MODULO SE REALIZAN LAS SIGUIENTES DECLARACIONES:

Public Carnet(5) As Integer

    Public Nombre(5) As String

    Public Nota1(5) As Integer

    Public Nota2(5) As Integer

    Public Nota3(5) As Integer

    Public Curso(5) As String

    Public Promedio(5) As Double

Public fila As Byte = 0

Public I As Byte

SUB SALIR

If MsgBox("¿Desea Salir?", vbQuestion + vbYesNo, "Mensaje Salida") = vbYes Then

            Form1.Close()

        Else

            Limpiar_entradas()

            Limpiar_estadisticas()

        End If

SUB LIMPIAR ENTRADAS

Form1.TextBox1.Clear()

        Form1.TextBox2.Clear()

        Form1.TextBox3.Clear()

        Form1.TextBox4.Clear()

        Form1.TextBox5.Clear()

        Form1.ComboBox1.Text = ""

        Form1.TextBox1.Focus()

SUB LIMPIAR ESTADISTICAS

Form1.TextBox6.Clear()

        Form1.TextBox7.Clear()

        Form1.TextBox8.Clear()

        Form1.TextBox10.Clear()

        Form1.TextBox11.Clear()

        Form1.TextBox12.Clear()

        Form1.TextBox10.Focus()

MOSTRAR VECTORES:

Form1.DataGridView1.Rows.Clear()

        For I = 0 To 4

If (Carnet(I) <> Nothing) Then

                Form1.DataGridView1.Rows.Add(Str(Carnet(I)), Nombre(I), Str(Nota1(I)), Str(Nota2(I)), Str(Nota3(I)), Curso(I), Str(Promedio(I)))

   Else

Exit For

            End If

        Next I

SUB LIMPIAR VECTORES:

Form1.DataGridView1.Rows.Clear()

fila = 0

For I = 0 To 4

            Carnet(I) = Nothing

            Nombre(I) = Nothing

            Nota1(I) = Nothing

            Nota2(I) = Nothing

            Nota3(I) = Nothing

            Curso(I) = Nothing

            Promedio(I) = Nothing

        Next I

SUB ORDEN ASCENDENTE:

Dim I As Byte, J As Byte

        Dim AUX1 As Integer, AUX2 As String

        For I = 0 To 3

            For J = 0 To 3

                If (Carnet(J) > Carnet(J + 1)) Then

                    AUX1 = Carnet(J + 1)

                    Carnet(J + 1) = Carnet(J)

                    Carnet(J) = AUX1

                    AUX2 = Nombre(J + 1)

                    Nombre(J + 1) = Nombre(J)

                    Nombre(J) = AUX2

                End If

            Next J

        Next I

SUB ORDEN DESCENDENTE:

Dim I As Byte, J As Byte

        Dim AUX1 As Integer, AUX2 As String

        For I = 0 To 3

            For J = 0 To 3

                If (Carnet(J) < Carnet(J + 1)) Then

                    AUX1 = Carnet(J + 1)

                    Carnet(J + 1) = Carnet(J)

                    Carnet(J) = AUX1

                    AUX2 = Nombre(J + 1)

                    Nombre(J + 1) = Nombre(J)

                    Nombre(J) = AUX2

                End If

            Next J

        Next I

EN FORM SE HACEN LA SIGUIENTE PROGRAMACIÓN:

BOTON ACEPTAR O AGREGAR:

   If (fila <= 4) Then

            Carnet(fila) = Val(TextBox1.Text)

            Nombre(fila) = TextBox2.Text

            Nota1(fila) = Val(TextBox3.Text)

            Nota2(fila) = Val(TextBox4.Text)

            Nota3(fila) = Val(TextBox5.Text)

            Curso(fila) = ComboBox1.Text

          Promedio(fila) = Round(((Nota1(fila) + Nota2(fila) + Nota3(fila)) / N), 2)

            fila = fila + 1

            limpiar_entradas()

        End If

        If (fila = 5) Then

            MsgBox("vectores llenos")

...

Descargar como (para miembros actualizados) txt (7 Kb) pdf (68 Kb) docx (14 Kb)
Leer 7 páginas más »
Disponible sólo en Clubensayos.com