miércoles, 7 de marzo de 2012

promedio de estudiantes con for y con while

 Private Sub CommandButton1_Click()
for k= 2 to 11
cells(13,2)=cells(13,2)+(k,2)
next
for L= 14 to 14
cells(13,2)=cells(13,2)/(2,L)
next
end sub

rivate Sub CommandButton2_Click()
For r = 2 To 11
If Cells(r, 2) >= Cells(14, 2) Then
r = r + 1
End If
Next
MsgBox ("EL total de alumnos por encima del promedio es: ") + Str(r)
End Sub



Private Sub CommandButton1_Click()
p = 2
While (c <= 11)
k= k + Cells(c, 2)
p= p + 1
Wend
Cells(14, 2) = k / Cells(13, 2)
End Sub

Private Sub CommandButton2_Click()
d = 2
While (d <= 11)
If Cells(d, 11) >= Cells(14, 2) Then
po = po + 1
End If
Wend
MsgBox ("El total de alumnos encima del promedio es : ") + Str(g)
End Sub

No hay comentarios:

Publicar un comentario