You are on page 1of 3

DESARROLLO DE PROBLEMAS DE ALGORITMOS I

PROBLEMA 2
Public Class Form1

Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click

End Sub

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


Button1.Click
Dim nota As Single
nota = Val(TextBox1.Text)
Select Case nota
Case Is < 0
Label2.Text = " nota invalida "
Case 0 To 5
Label2.Text = "no tiene derecho a rendir aplazado"
Case 6 To 10
Label2.Text = "Desaprobado"
Case 11 To 15
Label2.Text = "Alumno regular"
Case 16 To 20
Label2.Text = "Alunmo excelente"
Case Is > 20
Label2.Text = "Nota invalida"
End Select
End Sub
End Class
PROBLEMA 1

Public Class Form1


Dim dias(6) As String
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles
Botonsalir.Click
Me.Close()

End Sub

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


dias(0) = "Lunes"
dias(1) = "Martes"
dias(2) = "Miercoles"
dias(3) = "Jueves"
dias(4) = "Viernes"
dias(5) = "Sabado"
dias(6) = "Domingo"
End Sub

Private Sub Bottomok_Click(sender As Object, e As EventArgs) Handles


Bottomok.Click
Dim n As Integer
n = Val(Me.txtnumero.Text)
If n >= 1 And n <= 7 Then
Me.lblnombdia.Text = "el numero ingresado representa el dia " +
CStr(dias(n - 1))
Else
MsgBox("solo numero del 1 al 7", MsgBoxStyle.Information, "por favor")
Me.txtnumero.Text = ""
Me.txtnumero.Focus()
End If
End Sub

Private Sub lblnombdia_Click(sender As Object, e As EventArgs) Handles


lblnombdia.Click

End Sub
End Class

You might also like