Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Private Sub Command1_Click()
- Dim n1 As Double
- Dim n2 As Double
- Dim n3 As Double
- Dim prom As Double
- Dim swiche As Boolean
- n1 = txtNota1.Text
- n2 = txtNota2.Text
- n3 = txtNota3.Text
- If (n1 >= 0 And n1 <= 5) And (n2 >= 0 And n2 <= 5) And (n3 >= 0 And n3 <= 5) Then
- swiche = True
- Else
- swiche = False
- End If
- If swiche = True Then
- prom = (n1 + n2 + n3) / 3
- txtResultado.Text = prom
- If prom >= "3,5" Then MsgBox ("Ganas La Materia")
- Else
- MsgBox ("Pierdes La Materia")
- End If
- ElseIf swiche = False Then
- MsgBox ("Error!, Ingrese Notas entre 0,0 y 5,0")
- End If
- End Sub
Add Comment
Please, Sign In to add comment