Guest User

Untitled

a guest
Dec 8th, 2018
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Sub Command1_Click()
  2. Dim n1 As Double
  3. Dim n2 As Double
  4. Dim n3 As Double
  5. Dim prom As Double
  6. Dim swiche As Boolean
  7.  
  8. n1 = txtNota1.Text
  9. n2 = txtNota2.Text
  10. n3 = txtNota3.Text
  11. If (n1 >= 0 And n1 <= 5) And (n2 >= 0 And n2 <= 5) And (n3 >= 0 And n3 <= 5) Then
  12. swiche = True
  13. Else
  14.  swiche = False
  15. End If
  16.  
  17. If swiche = True Then
  18.     prom = (n1 + n2 + n3) / 3
  19.     txtResultado.Text = prom
  20.     If prom >= "3,5" Then MsgBox ("Ganas La Materia")
  21.         Else
  22.          MsgBox ("Pierdes La Materia")
  23.     End If
  24. ElseIf swiche = False Then
  25. MsgBox ("Error!, Ingrese Notas entre 0,0 y 5,0")
  26. End If
  27.  
  28.  
  29. End Sub
Add Comment
Please, Sign In to add comment