0% found this document useful (0 votes)
35 views3 pages

Desarrollo de Problemas Algoritmos I Problema 2

The document contains code for two problems in Visual Basic. Problem 1 involves storing the names of days of the week in an array, accepting a number input between 1-7, and displaying the corresponding day name. Problem 2 involves accepting a numeric grade as input, evaluating it in a select case statement, and displaying the corresponding performance level.

Uploaded by

Alex Varela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views3 pages

Desarrollo de Problemas Algoritmos I Problema 2

The document contains code for two problems in Visual Basic. Problem 1 involves storing the names of days of the week in an array, accepting a number input between 1-7, and displaying the corresponding day name. Problem 2 involves accepting a numeric grade as input, evaluating it in a select case statement, and displaying the corresponding performance level.

Uploaded by

Alex Varela
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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