Desarrolle un algoritmo que permita convertir calificaciones numéricas, según la siguiente tabla:
A = 19 y 20, B =16, 17 y 18, C = 13, 14 y 15, D = 10, 11 y 12, E = 1 hasta el 9. Se asume que la nota está comprendida entre 1 y 20.
Solución
- Entrada: 15
- Salida: Su nota es C
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles Button1.Click
Dim N As Integer
N = TextBox1.Text
If (N = 19 Or N = 20) Then
TextBox2.Text = "Tu nota es A"
Else
If (N <= 18 And N >= 16) Then
TextBox2.Text = "Tu nota es B"
Else
If (N <= 15 And N >= 13) Then
TextBox2.Text = "Tu nota es C"
Else
If (N <= 12 And N >= 10) Then
TextBox2.Text = "Tu nota es D"
Else
If (N <= 9 And N >= 1) Then
TextBox2.Text = "Tu nota es E"
Else
TextBox2.Text =
"Esta fuera del rango entre 1 y 20"
End If
End If
End If
End If
End If
End Sub
End Class

0 comentarios:
Publicar un comentario